From a6650a997c975d09a7c881329564cdfe5626e1b6 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann <jannis@xfce.org> Date: Fri, 15 Apr 2011 14:07:52 +0200 Subject: [PATCH] Improve the UI according to bugs #7496 and #7497. --- NEWS | 1 + thunar/thunar-statusbar.c | 37 +++++++++++++++++++++++++------------ thunar/thunar-window.c | 12 ++++++------ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/NEWS b/NEWS index d037059dc..d8881cee5 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ Reported and solved by Ambroz Bizjak. - Use portable abicheck.sh from xfconf. - Avoid segfaults due to interpreting display names as format strings. +- Improve the UI according to bugs #7496 and #7497. 1.3.0 ===== diff --git a/thunar/thunar-statusbar.c b/thunar/thunar-statusbar.c index 5222eafc9..3b8533b9d 100644 --- a/thunar/thunar-statusbar.c +++ b/thunar/thunar-statusbar.c @@ -1,20 +1,22 @@ -/* $Id$ */ +/* vi:set et ai sw=2 sts=2 ts=2: */ /*- * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -64,6 +66,8 @@ G_DEFINE_TYPE (ThunarStatusbar, thunar_statusbar, GTK_TYPE_STATUSBAR) static void thunar_statusbar_class_init (ThunarStatusbarClass *klass) { + static gboolean style_initialized = FALSE; + GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); @@ -82,6 +86,15 @@ thunar_statusbar_class_init (ThunarStatusbarClass *klass) "text", NULL, EXO_PARAM_WRITABLE)); + + if (!style_initialized) + { + gtk_rc_parse_string ("style \"thunar-statusbar-internal\" {\n" + " GtkStatusbar::shadow-type = GTK_SHADOW_NONE\n" + "}\n" + "class \"ThunarStatusbar\" " + "style \"thunar-statusbar-internal\"\n"); + } } diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 4735b3b79..d258d8f61 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -1,7 +1,7 @@ /* vi:set et ai sw=2 sts=2 ts=2: */ /*- * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> - * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> + * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -821,7 +821,7 @@ thunar_window_init (ThunarWindow *window) } window->paned = gtk_hpaned_new (); - gtk_container_set_border_width (GTK_CONTAINER (window->paned), 6); + gtk_container_set_border_width (GTK_CONTAINER (window->paned), 0); gtk_table_attach (GTK_TABLE (window->table), window->paned, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (window->paned); @@ -832,7 +832,7 @@ thunar_window_init (ThunarWindow *window) /* always remember the last separator position for newly opened windows */ exo_binding_new (G_OBJECT (window->paned), "position", G_OBJECT (window->preferences), "last-separator-position"); - window->view_box = gtk_vbox_new (FALSE, 6); + window->view_box = gtk_table_new (3, 1, FALSE); gtk_paned_pack2 (GTK_PANED (window->paned), window->view_box, TRUE, FALSE); gtk_widget_show (window->view_box); @@ -1290,7 +1290,7 @@ thunar_window_install_location_bar (ThunarWindow *window, else { /* it's a standalone location bar, just place it above the view */ - gtk_box_pack_start (GTK_BOX (window->view_box), window->location_bar, FALSE, FALSE, 0); + gtk_table_attach (GTK_TABLE (window->view_box), window->location_bar, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 6); } /* display the new location bar widget */ @@ -1806,7 +1806,7 @@ thunar_window_action_statusbar_changed (GtkToggleAction *action, { /* setup a new statusbar */ window->statusbar = thunar_statusbar_new (); - gtk_table_attach (GTK_TABLE (window->table), window->statusbar, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (window->view_box), window->statusbar, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (window->statusbar); /* connect to the view (if any) */ @@ -1903,7 +1903,7 @@ thunar_window_action_view_changed (GtkRadioAction *action, exo_binding_new (G_OBJECT (window->view), "loading", G_OBJECT (window->throbber), "animated"); exo_binding_new (G_OBJECT (window->view), "selected-files", G_OBJECT (window->launcher), "selected-files"); exo_mutual_binding_new (G_OBJECT (window->view), "zoom-level", G_OBJECT (window), "zoom-level"); - gtk_box_pack_end (GTK_BOX (window->view_box), window->view, TRUE, TRUE, 0); + gtk_table_attach (GTK_TABLE (window->view_box), window->view, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_grab_focus (window->view); gtk_widget_show (window->view); -- GitLab