Skip to content

Commit

Permalink
UI tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Darby Johnston <[email protected]>
  • Loading branch information
darbyjohnston committed Nov 10, 2024
1 parent 0b3c379 commit 184ac68
Show file tree
Hide file tree
Showing 15 changed files with 259 additions and 183 deletions.
2 changes: 1 addition & 1 deletion cmake/SuperBuild/Builddtk-deps.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(ExternalProject)

set(dtk_GIT_REPOSITORY "https://github.com/darbyjohnston/dtk.git")
set(dtk_GIT_TAG "0.1.0")
set(dtk_GIT_TAG "d3fb154f63d96f3f3d8bb6b650c4165049767824")

set(dtk-deps_ARGS
${toucan_EXTERNAL_PROJECT_ARGS}
Expand Down
2 changes: 1 addition & 1 deletion cmake/SuperBuild/Builddtk.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(ExternalProject)

set(dtk_GIT_REPOSITORY "https://github.com/darbyjohnston/dtk.git")
set(dtk_GIT_TAG "0.1.0")
set(dtk_GIT_TAG "d3fb154f63d96f3f3d8bb6b650c4165049767824")

set(dtk_DEPS dtk-deps)
set(dtk_ARGS
Expand Down
8 changes: 4 additions & 4 deletions lib/toucanView/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(HEADERS
App.h
BottomBar.h
ClipItem.h
DocumentTab.h
Document.h
Expand All @@ -11,8 +10,9 @@ set(HEADERS
GraphTool.h
IItem.h
IToolWidget.h
InspectorTool.h
JSONTool.h
MenuBar.h
PlaybackBar.h
PlaybackModel.h
SelectionModel.h
StackItem.h
Expand All @@ -30,7 +30,6 @@ set(HEADERS

set(SOURCE
App.cpp
BottomBar.cpp
ClipItem.cpp
DocumentTab.cpp
Document.cpp
Expand All @@ -41,8 +40,9 @@ set(SOURCE
GraphTool.cpp
IItem.cpp
IToolWidget.cpp
InspectorTool.cpp
JSONTool.cpp
MenuBar.cpp
PlaybackBar.cpp
PlaybackModel.cpp
SelectionModel.cpp
StackItem.cpp
Expand Down
34 changes: 17 additions & 17 deletions lib/toucanView/InspectorTool.cpp → lib/toucanView/JSONTool.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the toucan project.

#include "InspectorTool.h"
#include "JSONTool.h"

#include "App.h"

Expand All @@ -12,12 +12,12 @@

namespace toucan
{
void InspectorWidget::_init(
void JSONWidget::_init(
const std::shared_ptr<dtk::Context>& context,
const OTIO_NS::SerializableObject::Retainer<OTIO_NS::Item>& item,
const std::shared_ptr<dtk::IWidget>& parent)
{
IWidget::_init(context, "toucan::InspectorWidget", parent);
IWidget::_init(context, "toucan::JSONWidget", parent);

_item = item;

Expand All @@ -30,42 +30,42 @@ namespace toucan
_bellows->setOpen(true);
}

InspectorWidget::~InspectorWidget()
JSONWidget::~JSONWidget()
{}

std::shared_ptr<InspectorWidget> InspectorWidget::create(
std::shared_ptr<JSONWidget> JSONWidget::create(
const std::shared_ptr<dtk::Context>& context,
const OTIO_NS::SerializableObject::Retainer<OTIO_NS::Item>& item,
const std::shared_ptr<dtk::IWidget>& parent)
{
auto out = std::shared_ptr<InspectorWidget>(new InspectorWidget);
auto out = std::shared_ptr<JSONWidget>(new JSONWidget);
out->_init(context, item, parent);
return out;
}

void InspectorWidget::setOpen(bool value)
void JSONWidget::setOpen(bool value)
{
_bellows->setOpen(value);
}

void InspectorWidget::setGeometry(const dtk::Box2I& value)
void JSONWidget::setGeometry(const dtk::Box2I& value)
{
IWidget::setGeometry(value);
_bellows->setGeometry(value);
}

void InspectorWidget::sizeHintEvent(const dtk::SizeHintEvent& event)
void JSONWidget::sizeHintEvent(const dtk::SizeHintEvent& event)
{
IWidget::sizeHintEvent(event);
_setSizeHint(_bellows->getSizeHint());
}

void InspectorTool::_init(
void JSONTool::_init(
const std::shared_ptr<dtk::Context>& context,
const std::shared_ptr<App>& app,
const std::shared_ptr<dtk::IWidget>& parent)
{
IToolWidget::_init(context, app, "toucan::InspectorTool", "Inspector", parent);
IToolWidget::_init(context, app, "toucan::JSONTool", "JSON", parent);

_layout = dtk::VerticalLayout::create(context, shared_from_this());
_layout->setSpacingRole(dtk::SizeRole::None);
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace toucan
auto context = getContext();
for (const auto& item : selection)
{
auto widget = InspectorWidget::create(context, item, _scrollLayout);
auto widget = JSONWidget::create(context, item, _scrollLayout);
_widgets.push_back(widget);
}
});
Expand All @@ -147,26 +147,26 @@ namespace toucan
});
}

InspectorTool::~InspectorTool()
JSONTool::~JSONTool()
{}

std::shared_ptr<InspectorTool> InspectorTool::create(
std::shared_ptr<JSONTool> JSONTool::create(
const std::shared_ptr<dtk::Context>& context,
const std::shared_ptr<App>& app,
const std::shared_ptr<dtk::IWidget>& parent)
{
auto out = std::shared_ptr<InspectorTool>(new InspectorTool);
auto out = std::shared_ptr<JSONTool>(new JSONTool);
out->_init(context, app, parent);
return out;
}

void InspectorTool::setGeometry(const dtk::Box2I& value)
void JSONTool::setGeometry(const dtk::Box2I& value)
{
IToolWidget::setGeometry(value);
_layout->setGeometry(value);
}

void InspectorTool::sizeHintEvent(const dtk::SizeHintEvent& event)
void JSONTool::sizeHintEvent(const dtk::SizeHintEvent& event)
{
IToolWidget::sizeHintEvent(event);
_setSizeHint(_layout->getSizeHint());
Expand Down
14 changes: 7 additions & 7 deletions lib/toucanView/InspectorTool.h → lib/toucanView/JSONTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace toucan
{
class Document;

class InspectorWidget : public dtk::IWidget
class JSONWidget : public dtk::IWidget
{
protected:
void _init(
Expand All @@ -23,9 +23,9 @@ namespace toucan
const std::shared_ptr<IWidget>& parent);

public:
virtual ~InspectorWidget();
virtual ~JSONWidget();

static std::shared_ptr<InspectorWidget> create(
static std::shared_ptr<JSONWidget> create(
const std::shared_ptr<dtk::Context>&,
const OTIO_NS::SerializableObject::Retainer<OTIO_NS::Item>&,
const std::shared_ptr<IWidget>& parent = nullptr);
Expand All @@ -40,7 +40,7 @@ namespace toucan
std::shared_ptr<dtk::Bellows> _bellows;
};

class InspectorTool : public IToolWidget
class JSONTool : public IToolWidget
{
protected:
void _init(
Expand All @@ -49,9 +49,9 @@ namespace toucan
const std::shared_ptr<IWidget>& parent);

public:
virtual ~InspectorTool();
virtual ~JSONTool();

static std::shared_ptr<InspectorTool> create(
static std::shared_ptr<JSONTool> create(
const std::shared_ptr<dtk::Context>&,
const std::shared_ptr<App>&,
const std::shared_ptr<IWidget>& parent = nullptr);
Expand All @@ -65,7 +65,7 @@ namespace toucan
std::shared_ptr<dtk::VerticalLayout> _layout;
std::shared_ptr<dtk::ScrollWidget> _scrollWidget;
std::shared_ptr<dtk::VerticalLayout> _scrollLayout;
std::vector<std::shared_ptr<InspectorWidget> > _widgets;
std::vector<std::shared_ptr<JSONWidget> > _widgets;

std::shared_ptr<dtk::ValueObserver<std::shared_ptr<Document> > > _documentObserver;
std::shared_ptr<dtk::ListObserver<OTIO_NS::SerializableObject::Retainer<OTIO_NS::Item> > > _selectionObserver;
Expand Down
Loading

0 comments on commit 184ac68

Please sign in to comment.