diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-30 14:13:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-30 14:47:51 +0100 |
commit | 42cd492b83cf78647ba1a7fead2860410b01c297 (patch) | |
tree | 7551c6343b7512b472a5c5eeeec5187079363dc8 /vcl/unx | |
parent | 112e5f302e3508de6cf51e7d6ee9420df2b1b723 (diff) |
gtk3: Set tab normal/rollover/hightlight text colors
Change-Id: I4dff83941df62bcd5ec5a70a87f59e9ce17c979d
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 95 | ||||
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.cxx | 5 |
4 files changed, 73 insertions, 35 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 64cc7def944d..a3b6cb0df03c 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3927,6 +3927,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetGroupTextColor( aTextColor ); aStyleSet.SetLabelTextColor( aTextColor ); aStyleSet.SetInfoTextColor( aTextColor ); + aStyleSet.SetTabTextColor( aTextColor ); + aStyleSet.SetTabRolloverTextColor( aTextColor ); + aStyleSet.SetTabHighlightTextColor( aTextColor ); // Tooltip colors GtkStyle* pTooltipStyle = gtk_widget_get_style( gWidgetData[m_nXScreen].gTooltipPopup ); diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index e462f935cc8b..9ee90c47e508 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1233,34 +1233,34 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetHelpColor( getColor( tooltip_bg_color )); aStyleSet.SetHelpTextColor( getColor( tooltip_fg_color )); -{ // FIXME: turn me into a helper function ... - // construct style context for text view - GtkStyleContext *pCStyle = gtk_style_context_new(); - gtk_style_context_set_screen( pCStyle, gtk_window_get_screen( GTK_WINDOW( mpWindow ) ) ); - GtkWidgetPath *pCPath = gtk_widget_path_new(); - gtk_widget_path_append_type( pCPath, GTK_TYPE_TEXT_VIEW ); - gtk_widget_path_iter_add_class( pCPath, -1, GTK_STYLE_CLASS_VIEW ); - gtk_style_context_set_path( pCStyle, pCPath ); - gtk_widget_path_free( pCPath ); - - // highlighting colors - gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); - ::Color aHighlightColor = getColor( text_color ); - gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); - ::Color aHighlightTextColor = getColor( text_color ); - aStyleSet.SetHighlightColor( aHighlightColor ); - aStyleSet.SetHighlightTextColor( aHighlightTextColor ); - - // field background color - GdkRGBA field_background_color; - gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &field_background_color); - g_object_unref( pCStyle ); - - ::Color aBackFieldColor = getColor( field_background_color ); - aStyleSet.SetFieldColor( aBackFieldColor ); - // This baby is the default page/paper color - aStyleSet.SetWindowColor( aBackFieldColor ); -} + { + // construct style context for text view + GtkStyleContext *pCStyle = gtk_style_context_new(); + gtk_style_context_set_screen( pCStyle, gtk_window_get_screen( GTK_WINDOW( mpWindow ) ) ); + GtkWidgetPath *pCPath = gtk_widget_path_new(); + gtk_widget_path_append_type( pCPath, GTK_TYPE_TEXT_VIEW ); + gtk_widget_path_iter_add_class( pCPath, -1, GTK_STYLE_CLASS_VIEW ); + gtk_style_context_set_path( pCStyle, pCPath ); + gtk_widget_path_free( pCPath ); + + // highlighting colors + gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); + ::Color aHighlightColor = getColor( text_color ); + gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); + ::Color aHighlightTextColor = getColor( text_color ); + aStyleSet.SetHighlightColor( aHighlightColor ); + aStyleSet.SetHighlightTextColor( aHighlightTextColor ); + + // field background color + GdkRGBA field_background_color; + gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &field_background_color); + g_object_unref( pCStyle ); + + ::Color aBackFieldColor = getColor( field_background_color ); + aStyleSet.SetFieldColor( aBackFieldColor ); + // This baby is the default page/paper color + aStyleSet.SetWindowColor( aBackFieldColor ); + } // menu disabled entries handling aStyleSet.SetSkipDisabledInMenus( true ); @@ -1331,14 +1331,39 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) gdk_color_free(link_color); } -#if 0 - - // Tab colors - aStyleSet.SetActiveTabColor( aBackFieldColor ); // same as the window color. - Color aSelectedBackColor = getColor( pStyle->bg[GTK_STATE_ACTIVE] ); - aStyleSet.SetInactiveTabColor( aSelectedBackColor ); + { + GtkStyleContext *pCStyle = gtk_style_context_new(); + gtk_style_context_set_screen( pCStyle, gtk_window_get_screen( GTK_WINDOW( mpWindow ) ) ); + GtkWidgetPath *pCPath = gtk_widget_path_new(); + guint pos = gtk_widget_path_append_type(pCPath, GTK_TYPE_NOTEBOOK); + gtk_widget_path_iter_add_class(pCPath, 0, GTK_STYLE_CLASS_NOTEBOOK); + gtk_widget_path_iter_add_region(pCPath, pos, "tab", static_cast<GtkRegionFlags>(GTK_REGION_EVEN | GTK_REGION_FIRST)); + pos = gtk_widget_path_append_type (pCPath, GTK_TYPE_LABEL); + gtk_widget_path_iter_set_name(pCPath, pos, "first tab label"); + pCStyle = gtk_style_context_new(); + gtk_style_context_set_path(pCStyle, pCPath); + gtk_widget_path_free(pCPath); + + gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_NORMAL, &text_color); + aTextColor = getColor( text_color ); + aStyleSet.SetTabTextColor(aTextColor); + + // mouse over text colors + gtk_style_context_add_class(pCStyle, "prelight-page"); + gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_PRELIGHT, &text_color); + gtk_style_context_remove_class(pCStyle, "prelight-page"); + aTextColor = getColor( text_color ); + aStyleSet.SetTabRolloverTextColor(aTextColor); + + gtk_style_context_add_class(pCStyle, "active-page"); + gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_ACTIVE, &text_color); + gtk_style_context_remove_class(pCStyle, "active-page"); + aTextColor = getColor( text_color ); + aStyleSet.SetTabHighlightTextColor(aTextColor); + + g_object_unref( pCStyle ); + } -#endif // UI font const PangoFontDescription* font = gtk_style_context_get_font(pStyle, GTK_STATE_FLAG_NORMAL); OString aFamily = pango_font_description_get_family( font ); diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 69c00ba191f1..180e595f2d60 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1914,6 +1914,11 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetButtonTextColor( toColor( qColorGroup.buttonText() ) ); aStyleSettings.SetButtonRolloverTextColor( toColor( qColorGroup.buttonText() ) ); + // Tabs + aStyleSettings.SetTabTextColor( toColor( qColorGroup.buttonText() ) ); + aStyleSettings.SetTabRolloverTextColor( toColor( qColorGroup.buttonText() ) ); + aStyleSettings.SetTabHighlightTextColor( toColor( qColorGroup.buttonText() ) ); + // Disable color aStyleSettings.SetDisableColor( toColor( qColorGroup.mid() ) ); diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index c358f4d2ce32..fa18109c222a 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -233,6 +233,11 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetButtonTextColor( aButn ); style.SetButtonRolloverTextColor( aButn ); + // Tabs + style.SetTabTextColor( aButn ); + style.SetTabRolloverTextColor( aButn ); + style.SetTabHighlightTextColor( aButn ); + // Disable color style.SetDisableColor( aMid ); |