r298 - in trunk/src/target/OM-2007: artwork/themes/openmoko-standard/gtk-2.0 devel/qmake examples/openmoko-finger-demo/src openmoko-libs/libmokoui
mickey at gta01.hmw-consulting.de
mickey at gta01.hmw-consulting.de
Tue Dec 5 02:34:23 CET 2006
Author: mickey
Date: 2006-12-05 01:34:22 +0000 (Tue, 05 Dec 2006)
New Revision: 298
Modified:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokomenubox
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/openmoko-application-menu-bg.png
trunk/src/target/OM-2007/devel/qmake/openmoko-include.pro
trunk/src/target/OM-2007/examples/openmoko-finger-demo/src/demo-main.c
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-menu-box.c
Log:
mokoui: application menu item now is a GtkImageMenuItem. next step is to implement generic icon handling in the framework
Modified: trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokomenubox
===================================================================
--- trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokomenubox 2006-12-04 23:47:52 UTC (rev 297)
+++ trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokomenubox 2006-12-05 01:34:22 UTC (rev 298)
@@ -4,11 +4,11 @@
function = BOX
recolorable = TRUE
file = "openmoko-application-menu-bg.png"
- border = { 40, 20, 0, 0 }
+ border = { 0, 20, 0, 0 }
stretch = TRUE
}
}
- xthickness = 30
+ xthickness = 5
}
widget "*.mokomenubox-application-menubar" style "mokomenubox-application-menubar"
class "GtkMenuBar" style "mokomenubox-application-menubar"
Modified: trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/openmoko-application-menu-bg.png
===================================================================
(Binary files differ)
Modified: trunk/src/target/OM-2007/devel/qmake/openmoko-include.pro
===================================================================
--- trunk/src/target/OM-2007/devel/qmake/openmoko-include.pro 2006-12-04 23:47:52 UTC (rev 297)
+++ trunk/src/target/OM-2007/devel/qmake/openmoko-include.pro 2006-12-05 01:34:22 UTC (rev 298)
@@ -59,8 +59,14 @@
}
contains( CONFIG, debug ) {
- APPDIR = $(OPENMOKODIR)/applications/$$TARGET/data
- DEFINES += PKGDATADIR=\\\"$$APPDIR/\\\"
+ !contains( TEMPLATE, lib ) {
+ APPDIR = $(OPENMOKODIR)/applications/$$TARGET/data
+ DEFINES += PKGDATADIR=\\\"$$APPDIR/\\\"
+ }
+ contains( TEMPLATE, lib ) {
+ APPDIR = $(OPENMOKODIR)/openmoko-libs/data
+ DEFINES += PKGDATADIR=\\\"$$APPDIR/\\\"
+ }
}
!contains( CONFIG, debug ) {
APPDIR = /usr/share/$$TARGET
Modified: trunk/src/target/OM-2007/examples/openmoko-finger-demo/src/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-finger-demo/src/demo-main.c 2006-12-04 23:47:52 UTC (rev 297)
+++ trunk/src/target/OM-2007/examples/openmoko-finger-demo/src/demo-main.c 2006-12-05 01:34:22 UTC (rev 298)
@@ -47,6 +47,13 @@
show = !show;
}
+void cb_tool_button_clicked( GtkButton* button, MokoFingerWindow* window )
+{
+ if (!tools) return;
+ GtkButton* newbutton = moko_finger_tool_box_add_button( tools );
+ g_signal_connect( G_OBJECT(newbutton), "clicked", G_CALLBACK(cb_tool_button_clicked), window );
+}
+
void cb_black_button_clicked( GtkButton* button, MokoFingerWindow* window )
{
g_debug( "openmoko-finger-demo: black button clicked" );
@@ -55,8 +62,11 @@
if (!tools)
{
tools = moko_finger_window_get_toolbox(window);
- for ( int i = 0; i < 1; ++i )
- moko_finger_tool_box_add_button( tools );
+ for ( int i = 0; i < 4; ++i )
+ {
+ GtkButton* newbutton = moko_finger_tool_box_add_button( tools );
+ g_signal_connect( G_OBJECT(newbutton), "clicked", G_CALLBACK(cb_tool_button_clicked), window );
+ }
}
if ( show )
@@ -69,8 +79,7 @@
void cb_dialer_button_clicked( GtkButton* button, MokoFingerWindow* window )
{
- if (!tools) return;
- moko_finger_tool_box_add_button( tools );
+ // ...
}
int main( int argc, char** argv )
@@ -100,7 +109,7 @@
vbox = gtk_vbox_new( TRUE, 0 );
GtkLabel* label1 = gtk_label_new( "Populate this area with finger widgets\n \nThere are three types of finger buttons:" );
- GtkLabel* label2 = gtk_label_new( "Orange button toggles finger scrolling wheel\nBlack button toggles finger toolbar\nDialer Button adds a tool button" );
+ GtkLabel* label2 = gtk_label_new( "Orange button toggles finger scrolling wheel\nBlack button toggles finger toolbar\nDialer Button shows a dialog\n \n \n" );
GtkHBox* hbox = gtk_hbox_new( TRUE, 10 );
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-menu-box.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-menu-box.c 2006-12-04 23:47:52 UTC (rev 297)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-menu-box.c 2006-12-05 01:34:22 UTC (rev 298)
@@ -18,6 +18,8 @@
*/
#include "moko-menu-box.h"
+#include <gtk/gtkimage.h>
+#include <gtk/gtkimagemenuitem.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkmenubar.h>
#include <gtk/gtkmenuitem.h>
@@ -34,7 +36,7 @@
typedef struct _MokoMenuBoxPriv
{
GtkMenuBar* menubar_l;
- GtkMenuItem* appitem;
+ GtkImageMenuItem* appitem;
GtkMenu* appmenu;
GtkMenuBar* menubar_r;
GtkMenuItem* filteritem;
@@ -153,7 +155,10 @@
gtk_box_pack_start( GTK_BOX(self), GTK_WIDGET(priv->menubar_l), TRUE, TRUE, 0 );
}
- GtkMenuItem* appitem = gtk_menu_item_new_with_label( g_get_application_name() );
+ GtkImageMenuItem* appitem = gtk_image_menu_item_new_with_label( g_get_application_name() );
+ //FIXME implement icon handling properly in moko_application
+ GtkImage* appicon = gtk_image_new_from_file( PKGDATADIR "/unknown" ); // openmoko-logo-alpha.png" );
+ gtk_image_menu_item_set_image( appitem, appicon );
gtk_widget_set_name( GTK_WIDGET(appitem), "transparent" );
priv->appitem = appitem;
priv->appmenu = menu;
@@ -187,8 +192,7 @@
g_signal_connect( GTK_WIDGET(priv->menubar_r), "button-press-event", G_CALLBACK(cb_button_release), menu );
}
-void
-moko_menu_box_set_active_filter(MokoMenuBox* self, gchar* text)
+void moko_menu_box_set_active_filter(MokoMenuBox* self, gchar* text)
{
//FIXME this only works with text labels
moko_debug( "moko_menu_box_set_active_filter" );
More information about the commitlog
mailing list