]> spindle.queued.net Git - midori/commitdiff
Define H and V widget functions for GTK+3
authorChristian Dywan <christian@twotoasts.de>
Mon, 28 Nov 2011 22:37:34 +0000 (23:37 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 28 Nov 2011 22:37:34 +0000 (23:37 +0100)
The horizontal variants are gone from the API.

gtk_rc_get_theme_dir has been deprecated, there is
no replacement so we do the equivalent lookup.

Right-aligned menu items are deprecated.

For now defining gtk_widget_render_icon and
gtk_widget_set_size_request gets rid of warnings.

katze/gtk3-compat.h
katze/katze-utils.h
midori/midori-browser.c
midori/midori-websettings.c

index c1a2dd5f9eb851f5fc9473d81633a40ef39af3a3..fddfe977e8a30f73d776ab07f8c07864eedfeb79 100644 (file)
@@ -19,6 +19,15 @@ G_BEGIN_DECLS
     #define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
         "homogeneous", hmg, "spacing", spc, \
         "orientation", GTK_ORIENTATION_HORIZONTAL, NULL)
+    #define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL)
+    #define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL)
+    #define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
+        "orientation", GTK_ORIENTATION_VERTICAL, NULL)
+    /* FIXME */
+    #define gtk_widget_render_icon(wdgt, stk, sz, dtl) \
+        gtk_widget_render_icon_pixbuf(wdgt, stk, sz)
+    #define gtk_widget_size_request(wdgt, req) \
+        gtk_widget_get_preferred_size(wdgt, req, NULL)
 #endif
 
 #if !GLIB_CHECK_VERSION (2, 32, 0)
index c00ebd7c4e3d10b3b8e9a7e2ca83c3b3c72a806b..643b42384eaf6776aaf98a3a29b6950c19e73237 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <gtk/gtk.h>
 #include "katze-array.h"
+#include "gtk3-compat.h"
 
 G_BEGIN_DECLS
 
index 6878f1e66e25848561a932ced1e4c3ca56f0ac7c..b91a30dd1c62838475056f6646218dac7bf23ebb 100644 (file)
@@ -2206,6 +2206,7 @@ midori_browser_class_init (MidoriBrowserClass* class)
                                      TRUE,
                                      flags));
 
+    #if !GTK_CHECK_VERSION (3, 0, 0)
     /* Add 2px space between tool buttons */
     gtk_rc_parse_string (
         "style \"tool-button-style\"\n {\n"
@@ -2214,6 +2215,7 @@ midori_browser_class_init (MidoriBrowserClass* class)
         "style \"tool-button-style\"\n"
         "widget \"MidoriBrowser.*.MidoriFindbar.Gtk*ToolButton\" "
         "style \"tool-button-style\"\n");
+    #endif
 }
 
 static void
@@ -6062,7 +6064,13 @@ midori_browser_init (MidoriBrowser* browser)
     gtk_widget_show (browser->throbber);
     gtk_container_add (GTK_CONTAINER (menuitem), browser->throbber);
     gtk_widget_set_sensitive (menuitem, FALSE);
+    #if GTK_CHECK_VERSION (3, 2, 0)
+    /* FIXME: Doesn't work */
+    gtk_widget_set_hexpand (menuitem, TRUE);
+    gtk_widget_set_halign (menuitem, GTK_ALIGN_END);
+    #else
     gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
+    #endif
     gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem);
     #endif
     browser->menu_tools = gtk_menu_new ();
index 246dd518b84f108f556ed387a813ef934fbf301c..83ad7fef010bc969622abe63c8bc5970ab8e5e9f 100644 (file)
@@ -1711,9 +1711,9 @@ midori_web_settings_get_property (GObject*    object,
             GdkScreen* screen = gdk_screen_get_default ();
             GtkSettings* settings = gtk_settings_get_for_screen (screen);
             gchar* theme = katze_object_get_string (settings, "gtk-theme-name");
-            gchar* folder = gtk_rc_get_theme_dir ();
-            gchar* filename = g_build_filename (folder, theme, "index.theme", NULL);
-            g_free (folder);
+            gchar* theme_file = g_build_filename ("themes", theme, "index.theme", NULL);
+            gchar* filename = sokoke_find_data_filename (theme_file, FALSE);
+            g_free (theme_file);
             web_settings->close_buttons_left = 1;
             if (g_access (filename, F_OK) != 0)
                 katze_assign (filename,