Add new "shade_empty" style to paint the empty shades label (fix #4225)

This commit is contained in:
David Capello 2023-12-14 14:26:34 -03:00
parent ed3bbd5ebf
commit 96ef977311
3 changed files with 14 additions and 4 deletions

View File

@ -993,6 +993,10 @@
<icon part="window_center_icon" color="button_hot_text" state="mouse" />
<icon part="window_center_icon" color="button_selected_text" state="selected" />
</style>
<style id="shade_empty">
<background color="editor_face" />
<text color="status_bar_text" />
</style>
<style id="shade_selection">
<background part="colorbar_selection_hot" />
</style>

View File

@ -983,6 +983,10 @@
<icon part="window_center_icon" color="button_hot_text" state="mouse" />
<icon part="window_center_icon" color="button_selected_text" state="selected" />
</style>
<style id="shade_empty">
<background color="editor_face" />
<text color="face" />
</style>
<style id="shade_selection">
<background part="colorbar_selection_hot" />
</style>

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2022 Igara Studio S.A.
// Copyright (C) 2019-2023 Igara Studio S.A.
// Copyright (C) 2018 David Capello
//
// This program is distributed under the terms of
@ -301,9 +301,11 @@ void ColorShades::onPaint(ui::PaintEvent& ev)
}
}
else {
g->fillRect(theme->colors.editorFace(), bounds);
g->drawAlignedUIText(text(), theme->colors.face(), gfx::ColorNone, bounds,
ui::CENTER | ui::MIDDLE);
ui::PaintWidgetPartInfo info;
const std::string& text = this->text();
info.text = &text;
theme->paintWidgetPart(
g, theme->styles.shadeEmpty(), bounds, info);
}
}