added a configurable canvas around button icons
authormishas <mikhail.sobolev@gmail.com>
Wed, 11 Apr 2007 16:43:33 +0000 (16:43 +0000)
committermishas <mikhail.sobolev@gmail.com>
Wed, 11 Apr 2007 16:43:33 +0000 (16:43 +0000)
git-svn-id: file:///svnroot/simple-launcher/trunk@164 3ba93dab-e023-0410-b42a-de7732cf370a

debian/changelog
simple-launcher.cc

index b45a50d..4017f64 100644 (file)
@@ -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
 
   * 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
   * 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 <mss@mawhrin.net>  Tue, 10 Apr 2007 20:09:10 +0300
+ -- Mikhail Sobolev <mss@mawhrin.net>  Wed, 11 Apr 2007 19:43:11 +0300
 
 simple-launcher (0.9.3) unstable; urgency=low
 
 
 simple-launcher (0.9.3) unstable; urgency=low
 
index fd82294..1e68c26 100644 (file)
@@ -82,6 +82,7 @@ private:
   bool myTransparent;
   // bool myShowInfobanner; // FIXME: to implement
   int myIconSize;
   bool myTransparent;
   // bool myShowInfobanner; // FIXME: to implement
   int myIconSize;
+  int myCanvasSize;
 
   static char *ourDirs[];
 };
 
   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() : 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) {
 }
 
 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);
       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);
 
       {
         GdkPixbuf *pixbuf = item->getIcon(myIconSize);
@@ -292,9 +294,9 @@ void SimpleLauncherApplet::updateWidget() {
   g_object_unref(G_OBJECT(group));
 
   if (button_no == 0) {
   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 {
   } 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);
   }
 
   gtk_widget_show_all(myWidget);