[gtk+/wip/baedert/drawing: 200/371] listbox: Remove view_window



commit 5987661945b5366a46ff1021ddfb8b07a578efb3
Author: Timm Bäder <mail baedert org>
Date:   Fri May 26 12:13:43 2017 +0200

    listbox: Remove view_window

 gtk/gtklistbox.c                         |   75 ------------------------------
 gtk/theme/Adwaita/gtk-contained-dark.css |   18 ++++++--
 gtk/theme/Adwaita/gtk-contained.css      |   18 ++++++--
 3 files changed, 28 insertions(+), 83 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 6f3c42b..e791670 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -81,8 +81,6 @@ typedef struct
 
   GtkWidget *placeholder;
 
-  GdkWindow *view_window;
-
   GtkListBoxSortFunc sort_func;
   gpointer sort_func_target;
   GDestroyNotify sort_func_target_destroy_notify;
@@ -206,10 +204,6 @@ static GSequenceIter*       gtk_list_box_get_previous_visible         (GtkListBo
                                                                        GSequenceIter       *iter);
 static GtkListBoxRow       *gtk_list_box_get_first_focusable          (GtkListBox          *box);
 static GtkListBoxRow       *gtk_list_box_get_last_focusable           (GtkListBox          *box);
-static void                 gtk_list_box_realize                      (GtkWidget           *widget);
-static void                 gtk_list_box_unrealize                    (GtkWidget           *widget);
-static void                 gtk_list_box_map                          (GtkWidget           *widget);
-static void                 gtk_list_box_unmap                        (GtkWidget           *widget);
 static void                 gtk_list_box_add                          (GtkContainer        *container,
                                                                        GtkWidget           *widget);
 static void                 gtk_list_box_remove                       (GtkContainer        *container,
@@ -392,10 +386,6 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
   widget_class->motion_notify_event = gtk_list_box_motion_notify_event;
   widget_class->show = gtk_list_box_show;
   widget_class->focus = gtk_list_box_focus;
-  widget_class->realize = gtk_list_box_realize;
-  widget_class->unrealize = gtk_list_box_unrealize;
-  widget_class->map = gtk_list_box_map;
-  widget_class->unmap = gtk_list_box_unmap;
   widget_class->compute_expand = gtk_list_box_compute_expand;
   widget_class->get_request_mode = gtk_list_box_get_request_mode;
   widget_class->measure = gtk_list_box_measure;
@@ -931,8 +921,6 @@ gtk_list_box_set_placeholder (GtkListBox *box,
 
   if (placeholder)
     {
-      if (priv->view_window)
-        gtk_widget_set_parent_window (placeholder, priv->view_window);
       gtk_widget_set_parent (placeholder, GTK_WIDGET (box));
       gtk_widget_set_child_visible (placeholder,
                                     priv->n_visible_rows == 0);
@@ -2051,60 +2039,6 @@ gtk_list_box_focus (GtkWidget        *widget,
 }
 
 static void
-gtk_list_box_realize (GtkWidget *widget)
-{
-  GtkListBox *box = GTK_LIST_BOX (widget);
-  GtkListBoxPrivate *priv = BOX_PRIV (box);
-  GtkAllocation allocation;
-
-  gtk_widget_get_allocation (widget, &allocation);
-
-  priv->view_window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
-                                            GDK_ALL_EVENTS_MASK,
-                                            &allocation);
-  gdk_window_set_user_data (priv->view_window, (GObject*) widget);
-
-  gtk_widget_forall (widget, (GtkCallback)gtk_widget_set_parent_window, priv->view_window);
-
-  GTK_WIDGET_CLASS (gtk_list_box_parent_class)->realize (widget);
-}
-
-static void
-gtk_list_box_unrealize (GtkWidget *widget)
-{
-  GtkListBox *box = GTK_LIST_BOX (widget);
-  GtkListBoxPrivate *priv = BOX_PRIV (box);
-
-  gtk_widget_unregister_window (widget, priv->view_window);
-  gdk_window_destroy (priv->view_window);
-  priv->view_window = NULL;
-
-  GTK_WIDGET_CLASS (gtk_list_box_parent_class)->unrealize (widget);
-}
-
-static void
-gtk_list_box_map (GtkWidget *widget)
-{
-  GtkListBox *box = GTK_LIST_BOX (widget);
-  GtkListBoxPrivate *priv = BOX_PRIV (box);
-
-  gdk_window_show (priv->view_window);
-
-  GTK_WIDGET_CLASS (gtk_list_box_parent_class)->map (widget);
-}
-
-static void
-gtk_list_box_unmap (GtkWidget *widget)
-{
-  GtkListBox *box = GTK_LIST_BOX (widget);
-  GtkListBoxPrivate *priv = BOX_PRIV (box);
-
-  GTK_WIDGET_CLASS (gtk_list_box_parent_class)->unmap (widget);
-
-  gdk_window_hide (priv->view_window);
-}
-
-static void
 list_box_add_visible_rows (GtkListBox *box,
                            gint        n)
 {
@@ -2319,8 +2253,6 @@ gtk_list_box_update_header (GtkListBox    *box,
           if (ROW_PRIV (row)->header != NULL)
             {
               g_hash_table_insert (priv->header_hash, ROW_PRIV (row)->header, row);
-              if (priv->view_window)
-                gtk_widget_set_parent_window (ROW_PRIV (row)->header, priv->view_window);
               gtk_widget_set_parent (ROW_PRIV (row)->header, GTK_WIDGET (box));
               gtk_widget_show (ROW_PRIV (row)->header);
             }
@@ -2627,11 +2559,6 @@ gtk_list_box_size_allocate (GtkWidget     *widget,
   int child_min;
 
 
-  if (priv->view_window != NULL)
-    gdk_window_move_resize (priv->view_window,
-                            allocation->x, allocation->y,
-                            allocation->width, allocation->height);
-
   child_allocation.x = allocation->x - allocation->x;
   child_allocation.y = allocation->y - allocation->y;
   child_allocation.width = allocation->width;
@@ -2788,8 +2715,6 @@ gtk_list_box_insert (GtkListBox *box,
   gtk_list_box_insert_css_node (box, GTK_WIDGET (row), iter);
 
   ROW_PRIV (row)->iter = iter;
-  if (priv->view_window)
-    gtk_widget_set_parent_window (GTK_WIDGET (row), priv->view_window);
   gtk_widget_set_parent (GTK_WIDGET (row), GTK_WIDGET (box));
   gtk_widget_set_child_visible (GTK_WIDGET (row), TRUE);
   ROW_PRIV (row)->visible = gtk_widget_get_visible (GTK_WIDGET (row));
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 166a2d8..64d25db 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -162,11 +162,21 @@ treeview entry.flat, treeview entry { border-radius: 0; background-image: none;
 
 treeview entry.flat:focus, treeview entry:focus { border-color: #215d9c; }
 
-.entry-tag { border-color: transparent; background-color: transparent; background-image: none; box-shadow: 
inset 0 1px rgba(255, 255, 255, 0); text-shadow: none; -gtk-icon-shadow: none; background-color: #0c0d0d; }
+.entry-tag { padding: 5px; margin-top: 2px; margin-bottom: 2px; border-style: none; color: #232729; 
background-color: #898b8b; }
 
-.entry-tag:hover { background-color: #232729; }
+:dir(ltr) .entry-tag { margin-left: 8px; margin-right: -5px; }
 
-.entry-tag .button { border-color: transparent; background-color: transparent; background-image: none; 
box-shadow: inset 0 1px rgba(255, 255, 255, 0); text-shadow: none; -gtk-icon-shadow: none; background-color: 
transparent; }
+:dir(rtl) .entry-tag { margin-left: -5px; margin-right: 8px; }
+
+.entry-tag:hover { background-color: #a3a4a4; }
+
+:backdrop .entry-tag { color: #252a2c; background-color: #5b5f60; }
+
+.entry-tag.button { background-color: transparent; color: rgba(35, 39, 41, 0.7); }
+
+:not(:backdrop) .entry-tag.button:hover { border: 1px solid #898b8b; color: #232729; }
+
+:not(:backdrop) .entry-tag.button:active { background-color: #898b8b; color: rgba(35, 39, 41, 0.7); }
 
 /*********** Buttons * */
 @keyframes needs_attention { from { background-image: radial-gradient(farthest-side, #3583d5 0%, rgba(53, 
131, 213, 0) 0%); }
@@ -763,7 +773,7 @@ menubar > menuitem:hover, .menubar > menuitem:hover { box-shadow: inset 0 -3px #
 
 menubar > menuitem:disabled, .menubar > menuitem:disabled { color: #919494; box-shadow: none; }
 
-menu, .menu, .context-menu { padding: 2px 0px; background-color: #262b2d; border: 1px solid #1b1f20; }
+menu, .menu, .context-menu { margin: 4px; padding: 2px 0px; background-color: #262b2d; border: 1px solid 
#1b1f20; }
 
 .csd menu, .csd .menu, .csd .context-menu { border: none; }
 
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 4efe951..9824b1f 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -162,11 +162,21 @@ treeview entry.flat, treeview entry { border-radius: 0; background-image: none;
 
 treeview entry.flat:focus, treeview entry:focus { border-color: #4a90d9; }
 
-.entry-tag { border-color: transparent; background-color: transparent; background-image: none; box-shadow: 
inset 0 1px rgba(255, 255, 255, 0); text-shadow: none; -gtk-icon-shadow: none; background-color: #e6e6e6; }
+.entry-tag { padding: 5px; margin-top: 2px; margin-bottom: 2px; border-style: none; color: #ffffff; 
background-color: #4a90d9; }
 
-.entry-tag:hover { background-color: #ffffff; }
+:dir(ltr) .entry-tag { margin-left: 8px; margin-right: -5px; }
 
-.entry-tag .button { border-color: transparent; background-color: transparent; background-image: none; 
box-shadow: inset 0 1px rgba(255, 255, 255, 0); text-shadow: none; -gtk-icon-shadow: none; background-color: 
transparent; }
+:dir(rtl) .entry-tag { margin-left: -5px; margin-right: 8px; }
+
+.entry-tag:hover { background-color: #74aae2; }
+
+:backdrop .entry-tag { color: #fcfcfc; background-color: #4a90d9; }
+
+.entry-tag.button { background-color: transparent; color: rgba(255, 255, 255, 0.7); }
+
+:not(:backdrop) .entry-tag.button:hover { border: 1px solid #4a90d9; color: #ffffff; }
+
+:not(:backdrop) .entry-tag.button:active { background-color: #4a90d9; color: rgba(255, 255, 255, 0.7); }
 
 /*********** Buttons * */
 @keyframes needs_attention { from { background-image: radial-gradient(farthest-side, #4a90d9 0%, rgba(74, 
144, 217, 0) 0%); }
@@ -771,7 +781,7 @@ menubar > menuitem:hover, .menubar > menuitem:hover { box-shadow: inset 0 -3px #
 
 menubar > menuitem:disabled, .menubar > menuitem:disabled { color: #8b8e8f; box-shadow: none; }
 
-menu, .menu, .context-menu { padding: 2px 0px; background-color: #ffffff; border: 1px solid #b6b6b3; }
+menu, .menu, .context-menu { margin: 4px; padding: 2px 0px; background-color: #ffffff; border: 1px solid 
#b6b6b3; }
 
 .csd menu, .csd .menu, .csd .context-menu { border: none; }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]