Mercurial > octave
changeset 24842:74229798f604
always select suitable icon color for sock widgets depending on title bar color
* octave-dock-widget.cc (handle_settings): get current color of the title bar
when not using custom styled title bars and select the button icon colors
accordingly
author | Torsten <mttl@mailbox.org> |
---|---|
date | Tue, 06 Mar 2018 18:48:09 +0100 |
parents | 9adc41f55e3d |
children | bf1bace6d01d |
files | libgui/src/octave-dock-widget.cc |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/octave-dock-widget.cc Tue Mar 06 12:21:00 2018 -0500 +++ b/libgui/src/octave-dock-widget.cc Tue Mar 06 18:48:09 2018 +0100 @@ -269,14 +269,23 @@ m_bg_color_active = settings->value ("DockWidgets/title_bg_color_active", default_var).value<QColor> (); + QColor bcol (m_bg_color); + QColor bcola (m_bg_color_active); + + if (! m_custom_style) + { + bcol = QWidget::palette ().color (m_title_widget->backgroundRole()); + bcola = bcol; + } + int r, g, b; - m_bg_color.getRgb (&r, &g, &b); + bcol.getRgb (&r, &g, &b); if (r+g+b < 400) m_icon_color = "-light"; else m_icon_color = ""; - m_bg_color_active.getRgb (&r, &g, &b); + bcola.getRgb (&r, &g, &b); if (r+g+b < 400) m_icon_color_active = "-light"; else