Define H and V widget functions for GTK+3

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.
This commit is contained in:
Christian Dywan 2011-11-28 23:37:34 +01:00
parent 668689fd17
commit b3344bf6f7
4 changed files with 21 additions and 3 deletions

View file

@ -19,6 +19,15 @@ G_BEGIN_DECLS
#define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \ #define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
"homogeneous", hmg, "spacing", spc, \ "homogeneous", hmg, "spacing", spc, \
"orientation", GTK_ORIENTATION_HORIZONTAL, NULL) "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 #endif
#if !GLIB_CHECK_VERSION (2, 32, 0) #if !GLIB_CHECK_VERSION (2, 32, 0)

View file

@ -15,6 +15,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "katze-array.h" #include "katze-array.h"
#include "gtk3-compat.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -2206,6 +2206,7 @@ midori_browser_class_init (MidoriBrowserClass* class)
TRUE, TRUE,
flags)); flags));
#if !GTK_CHECK_VERSION (3, 0, 0)
/* Add 2px space between tool buttons */ /* Add 2px space between tool buttons */
gtk_rc_parse_string ( gtk_rc_parse_string (
"style \"tool-button-style\"\n {\n" "style \"tool-button-style\"\n {\n"
@ -2214,6 +2215,7 @@ midori_browser_class_init (MidoriBrowserClass* class)
"style \"tool-button-style\"\n" "style \"tool-button-style\"\n"
"widget \"MidoriBrowser.*.MidoriFindbar.Gtk*ToolButton\" " "widget \"MidoriBrowser.*.MidoriFindbar.Gtk*ToolButton\" "
"style \"tool-button-style\"\n"); "style \"tool-button-style\"\n");
#endif
} }
static void static void
@ -6062,7 +6064,13 @@ midori_browser_init (MidoriBrowser* browser)
gtk_widget_show (browser->throbber); gtk_widget_show (browser->throbber);
gtk_container_add (GTK_CONTAINER (menuitem), browser->throbber); gtk_container_add (GTK_CONTAINER (menuitem), browser->throbber);
gtk_widget_set_sensitive (menuitem, FALSE); 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); gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
#endif
gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem);
#endif #endif
browser->menu_tools = gtk_menu_new (); browser->menu_tools = gtk_menu_new ();

View file

@ -1711,9 +1711,9 @@ midori_web_settings_get_property (GObject* object,
GdkScreen* screen = gdk_screen_get_default (); GdkScreen* screen = gdk_screen_get_default ();
GtkSettings* settings = gtk_settings_get_for_screen (screen); GtkSettings* settings = gtk_settings_get_for_screen (screen);
gchar* theme = katze_object_get_string (settings, "gtk-theme-name"); gchar* theme = katze_object_get_string (settings, "gtk-theme-name");
gchar* folder = gtk_rc_get_theme_dir (); gchar* theme_file = g_build_filename ("themes", theme, "index.theme", NULL);
gchar* filename = g_build_filename (folder, theme, "index.theme", NULL); gchar* filename = sokoke_find_data_filename (theme_file, FALSE);
g_free (folder); g_free (theme_file);
web_settings->close_buttons_left = 1; web_settings->close_buttons_left = 1;
if (g_access (filename, F_OK) != 0) if (g_access (filename, F_OK) != 0)
katze_assign (filename, katze_assign (filename,