summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ellis <johne@bellatlantic.net>1999-05-31 01:33:47 +0000
committerjohne <johne@src.gnome.org>1999-05-31 01:33:47 +0000
commitbb6e35da2cb61d0e816401172c103de4f1eff9c4 (patch)
tree7e0cf3c53a6def9ceb76702fcba7bf73f4fe4faa
parent054e818ba8d9d9ee7406571a6f8d48da43bdcb78 (diff)
Scaling now works with the panels's new size signal.drivemount-sizehints
Sun May 30 21:30:30 1999 John Ellis <johne@bellatlantic.net> * drivemount.c: Scaling now works with the panels's new size signal.
-rw-r--r--drivemount/ChangeLog4
-rw-r--r--drivemount/drivemount.c43
2 files changed, 31 insertions, 16 deletions
diff --git a/drivemount/ChangeLog b/drivemount/ChangeLog
index 5ac7d819f..375f5e670 100644
--- a/drivemount/ChangeLog
+++ b/drivemount/ChangeLog
@@ -1,3 +1,7 @@
+Sun May 30 21:30:30 1999 John Ellis <johne@bellatlantic.net>
+
+ * drivemount.c: Scaling now works with the panels's new size signal.
+
Fri May 28 14:28:23 1999 John Ellis <johne@bellatlantic.net>
* drivemount.c: Reorganized code, renamed a few functions. The new
diff --git a/drivemount/drivemount.c b/drivemount/drivemount.c
index e1382a397..06adcab3d 100644
--- a/drivemount/drivemount.c
+++ b/drivemount/drivemount.c
@@ -304,13 +304,13 @@ static void browse_cb (AppletWidget *widget, gpointer data)
static void calculate_icon_size(gint *width, gint *height, DriveData *dd)
{
- gint hint;
-
- /* buttons have border of 3, a panel less than 8 pixels wide? never. */
- hint = dd->sizehint - 6;
+ gint hint = dd->sizehint;
if (hint > SIZEHINT_MAX) hint = SIZEHINT_MAX;
+ /* buttons have border of 3, a panel less than 8 pixels wide? never. */
+ hint -= 6;
+
/* calculate the size */
if (dd->orient == ORIENT_LEFT || dd->orient == ORIENT_RIGHT)
{
@@ -508,15 +508,36 @@ void start_callback_update(DriveData *dd)
*-------------------------------------------------------------------------
*/
-#ifdef 0
static void applet_change_size(GtkWidget *w, PanelSizeType size, gpointer data)
{
DriveData *dd = data;
+
+#ifdef 0
+ /* at one time I thought it should be this simple:
+
dd->sizehint = (gint)size;
+ guess not ;) */
+#endif
+
+ switch (size)
+ {
+ case SIZE_TINY:
+ dd->sizehint = 24;
+ break;
+ case SIZE_STANDARD:
+ dd->sizehint = 46; /* should be 48, but this is 1:1 scale */
+ break;
+ case SIZE_LARGE:
+ dd->sizehint = 64;
+ break;
+ case SIZE_HUGE:
+ dd->sizehint = 80;
+ break;
+ }
+
reset_icon(dd);
}
-#endif
static void applet_change_orient(GtkWidget *w, PanelOrientType o, gpointer data)
{
@@ -585,18 +606,8 @@ static DriveData * create_drive_widget(GtkWidget *applet)
/* attach applet signals */
-#ifdef 0
- /*
- * APPLET SCALING SIGNAL SHOULD BE CONNECTED HERE, SOMEWHERE, I GUESS
- * perhaps it should be a signal similar to change_orient, but include
- * the size hint as well. (the applet should then be smart enough to figure
- * if the size hint is for it's width or height
- * note: please look at the current orient callback to see what needs to be
- * called to set the new size of the applet after setting dd->sizehint.
- */
gtk_signal_connect(GTK_OBJECT(applet),"change_size",
GTK_SIGNAL_FUNC(applet_change_size), dd);
-#endif
gtk_signal_connect(GTK_OBJECT(applet),"change_orient",
GTK_SIGNAL_FUNC(applet_change_orient), dd);