mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 15:29:40 +01:00
Previous update was reverted due to some reason. This commit re-introduce the update after following efforts: * rebase owl-window-menu.patch - Translate the menu of gtk_ui_manager to original gtk menu, to enable owl feature. * fix cross-compile issue - 0.9.7 use a temp binary, built from its own source code, to optimize the data file size. This binary for target can't run on build system. As this size optimization only gain 0.2K improvement for one data file(used for about dialog), disable it to work around this issue. No perf drop found after this fix. Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
81 lines
2.4 KiB
Diff
81 lines
2.4 KiB
Diff
0.9.7 use a new menu bar from gtk_ui_manager, so need a translation here to
|
|
enable owl menu
|
|
|
|
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
|
|
|
|
Index: pcmanfm-0.9.7/configure.ac
|
|
===================================================================
|
|
--- pcmanfm-0.9.7.orig/configure.ac 2010-07-27 10:28:12.000000000 +0800
|
|
+++ pcmanfm-0.9.7/configure.ac 2010-07-27 18:03:42.000000000 +0800
|
|
@@ -70,6 +70,8 @@
|
|
|
|
gtk_modules="gtk+-2.0 >= 2.16.0"
|
|
PKG_CHECK_MODULES(GTK, [$gtk_modules])
|
|
+OWL_LIBS="-lowl"
|
|
+GTK_LIBS="$GTK_LIBS $OWL_LIBS"
|
|
AC_SUBST(GTK_CFLAGS)
|
|
AC_SUBST(GTK_LIBS)
|
|
|
|
Index: pcmanfm-0.9.7/src/main-win.c
|
|
===================================================================
|
|
--- pcmanfm-0.9.7.orig/src/main-win.c 2010-07-27 10:56:08.000000000 +0800
|
|
+++ pcmanfm-0.9.7/src/main-win.c 2010-07-27 17:28:59.000000000 +0800
|
|
@@ -36,6 +36,8 @@
|
|
#include "main-win.h"
|
|
#include "pref.h"
|
|
|
|
+#include "libowl/owlwindowmenu.h"
|
|
+
|
|
static void fm_main_win_finalize (GObject *object);
|
|
G_DEFINE_TYPE(FmMainWin, fm_main_win, GTK_TYPE_WINDOW);
|
|
|
|
@@ -466,9 +468,27 @@
|
|
fm_main_win_chdir(win, path);
|
|
}
|
|
|
|
+/* Transfer gtk_ui_manager menubar to gtk menubar */
|
|
+static GtkWidget * ui_menubar_to_menu(GtkWidget *menubar)
|
|
+{
|
|
+ GtkWidget *main_menu;
|
|
+ GList *iter;
|
|
+
|
|
+ main_menu = gtk_menu_new();
|
|
+
|
|
+ for ( iter = gtk_container_get_children(GTK_CONTAINER(menubar));
|
|
+ iter;
|
|
+ iter = g_list_next(iter) )
|
|
+ {
|
|
+ GtkWidget *menu = GTK_WIDGET(iter->data);
|
|
+ gtk_widget_reparent(menu, main_menu);
|
|
+ }
|
|
+ return main_menu;
|
|
+}
|
|
+
|
|
static void fm_main_win_init(FmMainWin *self)
|
|
{
|
|
- GtkWidget *vbox, *menubar, *toolitem, *scroll;
|
|
+ GtkWidget *vbox, *menubar, *owl_menubar, *toolitem, *scroll;
|
|
GtkUIManager* ui;
|
|
GtkActionGroup* act_grp;
|
|
GtkAction* act;
|
|
@@ -537,7 +557,6 @@
|
|
|
|
self->popup = gtk_ui_manager_get_widget(ui, "/popup");
|
|
|
|
- gtk_box_pack_start( (GtkBox*)vbox, menubar, FALSE, TRUE, 0 );
|
|
gtk_box_pack_start( (GtkBox*)vbox, self->toolbar, FALSE, TRUE, 0 );
|
|
|
|
/* load bookmarks menu */
|
|
@@ -586,6 +605,11 @@
|
|
gtk_container_add( (GtkContainer*)self, vbox );
|
|
gtk_widget_show_all(vbox);
|
|
|
|
+ owl_menubar = ui_menubar_to_menu(menubar);
|
|
+ gtk_widget_show_all (owl_menubar);
|
|
+ owl_set_window_menu (GTK_WINDOW(self),
|
|
+ GTK_MENU(owl_menubar));
|
|
+
|
|
/* create new tab */
|
|
fm_main_win_add_tab(self, fm_path_get_home());
|
|
gtk_widget_grab_focus(self->folder_view);
|