mirror of https://github.com/aseprite/aseprite.git
[theme] New layout selector icon + bg color fixes
This commit is contained in:
parent
e0226d95d9
commit
d6c5ac6786
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -216,7 +216,7 @@
|
|||
<part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" />
|
||||
<part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" />
|
||||
<part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" />
|
||||
<part id="tab_bottom_normal" x="2" y="124" w="12" h="5" />
|
||||
<part id="tab_bottom_normal" x="2" y="124" w1="4" w2="5" w3="3" h1="2" h2="1" h3="2" />
|
||||
<part id="tab_filler" x="0" y="112" w="2" h="12" />
|
||||
<part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" />
|
||||
<part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" />
|
||||
|
@ -374,6 +374,7 @@
|
|||
<part id="icon_close" x="152" y="256" w="7" h="7" />
|
||||
<part id="icon_search" x="160" y="256" w="8" h="8" />
|
||||
<part id="icon_user_data" x="168" y="256" w="8" h="8" />
|
||||
<part id="icon_layout" x="176" y="256" w="5" h="6" />
|
||||
<part id="icon_pos" x="144" y="264" w="8" h="8" />
|
||||
<part id="icon_size" x="152" y="264" w="8" h="8" />
|
||||
<part id="icon_selsize" x="160" y="264" w="8" h="8" />
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
@ -212,7 +212,7 @@
|
|||
<part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" />
|
||||
<part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" />
|
||||
<part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" />
|
||||
<part id="tab_bottom_normal" x="2" y="124" w="12" h="5" />
|
||||
<part id="tab_bottom_normal" x="2" y="124" w1="4" w2="5" w3="3" h1="2" h2="1" h3="2" />
|
||||
<part id="tab_filler" x="0" y="112" w="2" h="12" />
|
||||
<part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" />
|
||||
<part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" />
|
||||
|
@ -370,6 +370,7 @@
|
|||
<part id="icon_close" x="152" y="256" w="7" h="7" />
|
||||
<part id="icon_search" x="160" y="256" w="8" h="8" />
|
||||
<part id="icon_user_data" x="168" y="256" w="8" h="8" />
|
||||
<part id="icon_layout" x="176" y="256" w="5" h="6" />
|
||||
<part id="icon_pos" x="144" y="264" w="8" h="8" />
|
||||
<part id="icon_size" x="152" y="264" w="8" h="8" />
|
||||
<part id="icon_selsize" x="160" y="264" w="8" h="8" />
|
||||
|
|
|
@ -154,10 +154,6 @@ Dock::Dock()
|
|||
m_sizes[i] = gfx::Size(0, 0);
|
||||
}
|
||||
|
||||
InitTheme.connect([this] {
|
||||
if (auto p = parent())
|
||||
setBgColor(p->bgColor());
|
||||
});
|
||||
initTheme();
|
||||
}
|
||||
|
||||
|
@ -408,7 +404,7 @@ void Dock::onPaint(ui::PaintEvent& ev)
|
|||
auto th = textHeight();
|
||||
if (isCustomizing()) {
|
||||
auto* theme = SkinTheme::get(this);
|
||||
const auto& color = theme->colors.workspaceText();
|
||||
const gfx::Color color = theme->colors.workspaceText();
|
||||
int handleSide = 0;
|
||||
if (auto* dockable = dynamic_cast<Dockable*>(widget))
|
||||
handleSide = dockable->dockHandleSide();
|
||||
|
@ -440,6 +436,12 @@ void Dock::onInitTheme(ui::InitThemeEvent& ev)
|
|||
Widget::onInitTheme(ev);
|
||||
setBorder(gfx::Border(0));
|
||||
setChildSpacing(4 * ui::guiscale());
|
||||
|
||||
for (int i = 0; i < kSides; ++i) {
|
||||
Widget* widget = m_sides[i];
|
||||
if (widget)
|
||||
widget->initTheme();
|
||||
}
|
||||
}
|
||||
|
||||
bool Dock::onProcessMessage(ui::Message* msg)
|
||||
|
|
|
@ -318,7 +318,7 @@ void LayoutSelector::LayoutComboBox::onCloseListBox()
|
|||
}
|
||||
|
||||
LayoutSelector::LayoutSelector(TooltipManager* tooltipManager)
|
||||
: m_button(SkinTheme::instance()->parts.iconUserData())
|
||||
: m_button(SkinTheme::instance()->parts.iconLayout())
|
||||
{
|
||||
setActiveLayoutId(Preferences::instance().general.workspaceLayout());
|
||||
|
||||
|
@ -396,14 +396,18 @@ void LayoutSelector::onInitTheme(ui::InitThemeEvent& ev)
|
|||
{
|
||||
VBox::onInitTheme(ev);
|
||||
|
||||
auto* theme = SkinTheme::get(this);
|
||||
setBgColor(theme->colors.windowFace());
|
||||
|
||||
noBorderNoChildSpacing();
|
||||
m_top.noBorderNoChildSpacing();
|
||||
m_center.noBorderNoChildSpacing();
|
||||
m_bottom.noBorderNoChildSpacing();
|
||||
m_comboBox.noBorderNoChildSpacing();
|
||||
m_button.noBorderNoChildSpacing();
|
||||
|
||||
auto* theme = SkinTheme::get(this);
|
||||
m_bottom.setStyle(theme->styles.tabBottom());
|
||||
auto hint = theme->calcSizeHint(&m_bottom, m_bottom.style());
|
||||
m_bottom.setMinSize(hint);
|
||||
m_bottom.setMinSize(gfx::Size(0, theme->dimensions.tabsBottomHeight()));
|
||||
}
|
||||
|
||||
void LayoutSelector::onAnimationFrame()
|
||||
|
|
|
@ -172,11 +172,6 @@ void MainWindow::initialize()
|
|||
|
||||
m_customizableDockPlaceholder = std::make_unique<Widget>();
|
||||
m_customizableDockPlaceholder->addChild(m_customizableDock);
|
||||
m_customizableDockPlaceholder->InitTheme.connect([this] {
|
||||
auto theme = static_cast<skin::SkinTheme*>(this->theme());
|
||||
m_customizableDock->setBgColor(theme->colors.workspace());
|
||||
});
|
||||
m_customizableDockPlaceholder->initTheme();
|
||||
|
||||
m_dock->top()->right()->dock(ui::RIGHT, m_notifications.get());
|
||||
m_dock->top()->right()->dock(ui::CENTER, m_layoutSelector.get());
|
||||
|
@ -206,6 +201,8 @@ void MainWindow::initialize()
|
|||
// When the language is changed, we reload the menu bar strings and
|
||||
// relayout the whole main window.
|
||||
Strings::instance()->LanguageChange.connect([this] { onLanguageChange(); });
|
||||
|
||||
initTheme();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -503,6 +500,10 @@ void MainWindow::onInitTheme(ui::InitThemeEvent& ev)
|
|||
noBorderNoChildSpacing();
|
||||
if (m_previewEditor)
|
||||
m_previewEditor->initTheme();
|
||||
|
||||
auto* theme = static_cast<skin::SkinTheme*>(this->theme());
|
||||
m_dock->setBgColor(theme->colors.windowFace());
|
||||
m_customizableDock->setBgColor(theme->colors.workspace());
|
||||
}
|
||||
|
||||
void MainWindow::onResize(ui::ResizeEvent& ev)
|
||||
|
|
Loading…
Reference in New Issue