[Libreoffice-commits] core.git: vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Wed May 20 04:12:17 PDT 2015
vcl/inc/unx/gtk/gtkgdi.hxx | 1 -
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 12 ++++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit 7cf1206e1e0872d8525f6012d0017917a4840783
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 20 12:10:34 2015 +0100
gtk3: focus rects for combobox entries
mpComboboxEntryStyle refuses to draw the left side. I have no
idea why and have burned too much time on it, so use the normal
EntryStyle and set its right junction to get the flat right side
Change-Id: Iff5fb1c1b21d2935c3817e7825b86b8e30e899eb
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index af86e7f..e0d0881 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -79,7 +79,6 @@ private:
static GtkStyleContext *mpMenuItemStyle;
static GtkStyleContext *mpSpinStyle;
static GtkStyleContext *mpComboboxStyle;
- static GtkStyleContext *mpComboboxEntryStyle;
static GtkStyleContext *mpComboboxButtonStyle;
static GtkStyleContext *mpListboxStyle;
static GtkStyleContext *mpListboxButtonStyle;
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 2a414dd..8ed73fe 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -35,7 +35,6 @@ GtkStyleContext* GtkSalGraphics::mpMenuStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpMenuItemStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpSpinStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpComboboxStyle = NULL;
-GtkStyleContext* GtkSalGraphics::mpComboboxEntryStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpComboboxButtonStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpListboxStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpListboxButtonStyle = NULL;
@@ -713,6 +712,10 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr,
if( nPart == PART_ENTIRE_CONTROL )
{
+ gtk_style_context_save(mpEntryStyle);
+ gtk_style_context_set_state(mpEntryStyle, flags);
+ gtk_style_context_set_junction_sides(mpEntryStyle, GTK_JUNCTION_RIGHT);
+
gtk_render_background(mpComboboxStyle, cr,
0, 0,
areaRect.GetWidth(), areaRect.GetHeight());
@@ -720,12 +723,14 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr,
0, 0,
areaRect.GetWidth(), areaRect.GetHeight());
- gtk_render_background(mpComboboxEntryStyle, cr,
+ gtk_render_background(mpEntryStyle, cr,
0, 0,
aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
- gtk_render_frame(mpComboboxEntryStyle, cr,
+ gtk_render_frame(mpEntryStyle, cr,
0, 0,
aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
+
+ gtk_style_context_restore(mpEntryStyle);
}
gtk_render_background(mpComboboxButtonStyle, cr,
@@ -2038,7 +2043,6 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
gtk_container_forall(GTK_CONTAINER(gComboBox),
get_combo_box_entry_inner_widgets,
NULL);
- mpComboboxEntryStyle = gtk_widget_get_style_context(gComboBoxEntryWidget);
mpComboboxButtonStyle = gtk_widget_get_style_context(gComboBoxButtonWidget);
/* Listbox */
More information about the Libreoffice-commits
mailing list