Skip to content

Commit

Permalink
Traktor: Restored "always visible" flag in DockPane.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed May 23, 2024
1 parent f06a576 commit 71a3968
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions code/Editor/App/EditorForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ bool EditorForm::create(const CommandLine& cmdLine)
paneCenter->setDetachable(false);

// Set pane styles.
m_paneEast->setAlwaysVisible(true);
m_paneSouth->setStackable(true);

// Create panes.
Expand Down
17 changes: 14 additions & 3 deletions code/Ui/DockPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ DockPane* DockPane::getPaneFromPosition(const Point& position)
}
}

//if (m_widget && m_widget->isVisible(false))
if (!m_widgets.empty())
return this;
else
Expand All @@ -387,7 +386,6 @@ DockPane* DockPane::getSplitterFromPosition(const Point& position)
}
}

//if (m_widget && m_widget->isVisible(false))
if (!m_widgets.empty())
return nullptr;
else
Expand All @@ -398,7 +396,7 @@ bool DockPane::hitGripper(const Point& position) const
{
T_ASSERT(m_rect.inside(position));

if (isSplitter()) // || (m_widget && !m_widget->isVisible(false)))
if (isSplitter())
return false;

return position.y >= m_rect.top && position.y <= m_rect.top + m_owner->pixel(m_gripperDim);
Expand Down Expand Up @@ -491,8 +489,21 @@ bool DockPane::isStackable() const
return m_stackable;
}

void DockPane::setAlwaysVisible(bool alwaysVisible)
{
m_alwaysVisible = alwaysVisible;
}

bool DockPane::isAlwaysVisible() const
{
return m_alwaysVisible;
}

bool DockPane::isVisible() const
{
if (m_alwaysVisible)
return true;

if (isSplitter())
return m_child[0]->isVisible() || m_child[1]->isVisible();

Expand Down
7 changes: 5 additions & 2 deletions code/Ui/DockPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ class T_DLLCLASS DockPane : public Object

void showTab(int32_t tab);


void showWidget(Widget* widget);

void hideWidget(Widget* widget);

bool isWidgetVisible(const Widget* widget) const;


DockPane* findWidgetPane(const Widget* widget);

DockPane* getPaneFromPosition(const Point& position);
Expand Down Expand Up @@ -103,6 +101,10 @@ class T_DLLCLASS DockPane : public Object

bool isStackable() const;

void setAlwaysVisible(bool alwaysVisible);

bool isAlwaysVisible() const;

bool isVisible() const;

private:
Expand All @@ -129,6 +131,7 @@ class T_DLLCLASS DockPane : public Object
bool m_detachable = true;
bool m_stackable = false;
bool m_vertical = false;
bool m_alwaysVisible = false;

void synchronizeVisibility();

Expand Down

0 comments on commit 71a3968

Please sign in to comment.