Introduce a "combobox" style to replace the way combobox entries are painted

This commit is contained in:
Martín Capello 2023-03-09 16:41:03 -03:00 committed by David Capello
parent 7a338250a3
commit b72d498070
2 changed files with 6 additions and 8 deletions

View File

@ -618,6 +618,10 @@
<text color="button_selected_text" state="selected" />
</style>
<style id="mini_check_box" extends="check_box" font="mini" />
<style id="combobox">
<background-border part="sunken2_focused" state="focus" />
<background-border part="sunken2_normal" />
</style>
<style id="combobox_button" extends="mini_button" padding="0">
<icon part="combobox_arrow_down" />
<icon part="combobox_arrow_down_selected" state="selected" />

View File

@ -1505,15 +1505,9 @@ void SkinTheme::paintComboBoxEntry(ui::PaintEvent& ev)
Graphics* g = ev.graphics();
Entry* widget = static_cast<Entry*>(ev.getSource());
gfx::Rect bounds = widget->clientBounds();
ui::Style* style = styles.combobox();
// Outside borders
g->fillRect(BGCOLOR, bounds);
drawRect(g, bounds,
(widget->hasFocus() ?
parts.sunken2Focused().get():
parts.sunken2Normal().get()));
paintWidget(g, widget, style, bounds);
drawEntryText(g, widget);
}