[Xfce4-commits] <thunar:jannis/new-shortcuts-pane> Rework shortcut row size calculation again. Still not finished I assume.
Jannis Pohlmann
noreply at xfce.org
Fri Jul 15 21:10:15 CEST 2011
Updating branch refs/heads/jannis/new-shortcuts-pane
to e2b6a9bc04dc4ce57a6e03d917927e37021934e3 (commit)
from 2bab015e0315659c0cbd1eaa21b874860cc7a663 (commit)
commit e2b6a9bc04dc4ce57a6e03d917927e37021934e3
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Tue Jun 7 01:30:13 2011 +0200
Rework shortcut row size calculation again. Still not finished I assume.
thunar/thunar-shortcut-row.c | 16 +++++-----------
thunar/thunar-shortcuts-model.c | 21 ++++-----------------
2 files changed, 9 insertions(+), 28 deletions(-)
diff --git a/thunar/thunar-shortcut-row.c b/thunar/thunar-shortcut-row.c
index 0b8a514..a37f5d5 100644
--- a/thunar/thunar-shortcut-row.c
+++ b/thunar/thunar-shortcut-row.c
@@ -38,7 +38,7 @@
-#define THUNAR_SHORTCUT_ROW_MIN_HEIGHT 24
+#define THUNAR_SHORTCUT_ROW_MIN_HEIGHT 26
@@ -656,7 +656,6 @@ thunar_shortcut_row_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
ThunarShortcutRow *row = THUNAR_SHORTCUT_ROW (widget);
- GtkRequisition button_requisition;
_thunar_return_if_fail (THUNAR_IS_SHORTCUT_ROW (widget));
@@ -665,17 +664,12 @@ thunar_shortcut_row_size_request (GtkWidget *widget,
g_debug ("computed height: %i", requisition->height);
- /* get the size request of the button */
- gtk_widget_size_request (row->action_button, &button_requisition);
-
- g_debug (" button height: %i", button_requisition.height);
- g_debug (" icon size + 4: %i", row->icon_size + 4);
+ g_debug (" icon size + 2: %i", row->icon_size + 2);
g_debug (" min height: %i", THUNAR_SHORTCUT_ROW_MIN_HEIGHT);
/* use the maximum of the computed requisition height, the button height,
* the icon size + 4, and the minimum allowed height for rows */
- requisition->height = MAX (requisition->height, button_requisition.height);
- requisition->height = MAX (requisition->height, (gint) row->icon_size + 4);
+ requisition->height = MAX (requisition->height, (gint) row->icon_size + 2);
requisition->height = MAX (requisition->height, THUNAR_SHORTCUT_ROW_MIN_HEIGHT);
g_debug (" => %i", requisition->height);
@@ -964,7 +958,7 @@ thunar_shortcut_row_eject_icon_changed (ThunarShortcutRow *row)
_thunar_return_if_fail (THUNAR_IS_SHORTCUT_ROW (row));
/* update the action button image */
- gtk_image_set_from_gicon (GTK_IMAGE (row->action_image), row->eject_icon,
+ gtk_image_set_from_gicon (GTK_IMAGE (row->action_image), row->eject_icon,
GTK_ICON_SIZE_MENU);
}
@@ -1040,7 +1034,7 @@ thunar_shortcut_row_icon_size_changed (ThunarShortcutRow *row)
_thunar_return_if_fail (THUNAR_IS_SHORTCUT_ROW (row));
gtk_image_set_pixel_size (GTK_IMAGE (row->icon_image), row->icon_size);
- gtk_image_set_pixel_size (GTK_IMAGE (row->action_image), row->icon_size - 2);
+ gtk_image_set_pixel_size (GTK_IMAGE (row->action_image), row->icon_size);
}
diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c
index 441fdef..e31cf43 100644
--- a/thunar/thunar-shortcuts-model.c
+++ b/thunar/thunar-shortcuts-model.c
@@ -1036,25 +1036,12 @@ thunar_shortcuts_model_load_system_shortcuts (gpointer user_data)
g_object_unref (desktop_file);
g_object_unref (home_file);
- /* create a trash shortcut */
- shortcut = g_slice_new0 (ThunarShortcut);
- shortcut->file = g_object_ref (desktop_file);
- shortcut->icon = g_themed_icon_new ("user-desktop");
- shortcut->name = g_strdup (_("Desktop"));
- shortcut->type = THUNAR_SHORTCUT_USER_DIRECTORY;
- shortcut->visible = TRUE;
- shortcut->mutable = FALSE;
- shortcut->persistent = TRUE;
-
- /* add the shortcut */
- thunar_shortcuts_model_add_shortcut (model, shortcut);
-
/* create a shortcut for the root file system */
shortcut = g_slice_new0 (ThunarShortcut);
- shortcut->file = thunar_g_file_new_for_root ();
- shortcut->icon = g_themed_icon_new ("harddrive");
- shortcut->name = g_strdup (g_get_host_name ());
- shortcut->type = THUNAR_SHORTCUT_SYSTEM_VOLUME;
+ shortcut->file = thunar_g_file_new_for_trash ();
+ shortcut->icon = g_themed_icon_new ("user-trash");
+ shortcut->name = g_strdup (_("Trash"));
+ shortcut->type = THUNAR_SHORTCUT_USER_DIRECTORY;
shortcut->visible = TRUE;
shortcut->mutable = FALSE;
shortcut->persistent = TRUE;
More information about the Xfce4-commits
mailing list