From: mishas Date: Wed, 11 Apr 2007 16:43:33 +0000 (+0000) Subject: added a configurable canvas around button icons X-Git-Url: http://git.maemo.org/git/?p=simple-launcher;a=commitdiff_plain;h=ee269356c06dc130ea0f556fdae93a10e794ca41 added a configurable canvas around button icons git-svn-id: file:///svnroot/simple-launcher/trunk@164 3ba93dab-e023-0410-b42a-de7732cf370a --- diff --git a/debian/changelog b/debian/changelog index b45a50d..4017f64 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -simple-launcher (0.9.4~12) unstable; urgency=low +simple-launcher (0.9.4~13) unstable; urgency=low * NOT RELEASED YET * settings dialog is moved into a separate class @@ -16,8 +16,9 @@ simple-launcher (0.9.4~12) unstable; urgency=low * make transparency code a bit more explicit * separate icon size used in the applet and the settings dialog * added dummy checkboxes and UI settings page + * added a configurable canvas around button icons - -- Mikhail Sobolev Tue, 10 Apr 2007 20:09:10 +0300 + -- Mikhail Sobolev Wed, 11 Apr 2007 19:43:11 +0300 simple-launcher (0.9.3) unstable; urgency=low diff --git a/simple-launcher.cc b/simple-launcher.cc index fd82294..1e68c26 100644 --- a/simple-launcher.cc +++ b/simple-launcher.cc @@ -82,6 +82,7 @@ private: bool myTransparent; // bool myShowInfobanner; // FIXME: to implement int myIconSize; + int myCanvasSize; static char *ourDirs[]; }; @@ -133,7 +134,7 @@ char *SimpleLauncherApplet::ourDirs[] = { }; // SimpleLauncherApplet::SimpleLauncherApplet() : myMainSettings(myClient.getKey(SL_APPLET_GCONF_PATH)), myContext(NULL), myWidget(NULL), myParent(NULL) { -SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(true), myIconSize(48) { +SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(true), myIconSize(48), myCanvasSize(1) { } bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) { @@ -272,6 +273,7 @@ void SimpleLauncherApplet::updateWidget() { g_signal_connect(button, "button-press-event", G_CALLBACK(_button_pressed), this); gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent); + gtk_container_set_border_width(GTK_CONTAINER(button), myCanvasSize); { GdkPixbuf *pixbuf = item->getIcon(myIconSize); @@ -292,9 +294,9 @@ void SimpleLauncherApplet::updateWidget() { g_object_unref(G_OBJECT(group)); if (button_no == 0) { - gtk_widget_set_size_request(myWidget, myIconSize, myIconSize); + gtk_widget_set_size_request(myWidget, myIconSize+myCanvasSize+myCanvasSize, myIconSize+myCanvasSize+myCanvasSize); } else { - gtk_widget_set_size_request(myWidget, button_no*myIconSize, myIconSize); + gtk_widget_set_size_request(myWidget, button_no*(myIconSize+myCanvasSize+myCanvasSize), myIconSize+myCanvasSize+myCanvasSize); } gtk_widget_show_all(myWidget);