Re: [Rhythmbox-devel] [patch] Minor UI polishing in the plugin configuration dialog
- From: "Christophe Dehais" <christophe dehais gmail com>
- To: "Rhythmbox-devel list" <rhythmbox-devel gnome org>
- Subject: Re: [Rhythmbox-devel] [patch] Minor UI polishing in the plugin configuration dialog
- Date: Sun, 18 Feb 2007 11:53:10 +0100
The same, but patch created with diff -u option (instead of -c)
C.
On 2/11/07, Christophe Dehais <christophe dehais gmail com> wrote:
Sorry, updating the patch ...
This version fixes the plugin list appearance described previously and
also adapt the size of the plugin icon so that it fits correctly in
the description (useful for big svg icons)
Also didn't mention that it's against current SVN.
Christophe
On 2/11/07, Christophe Dehais <christophe dehais gmail com> wrote:
> Hi!
>
> This patch makes the headers of the list of plugins fixed (don't
> scroll with the list itself) in the plugin configuration dialog.
>
> cheers,
> Christophe
>
>
--- rhythmbox/data/glade/plugins.glade 2007-02-15 22:29:28.000000000 +0100
+++ rb2/data/glade/plugins.glade 2007-02-11 17:32:25.000000000 +0100
@@ -33,31 +33,16 @@
<property name="spacing">12</property>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <widget class="GtkScrolledWindow" id="plugins_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
- <widget class="GtkViewport" id="viewport1">
- <property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
-
- <child>
- <widget class="GtkVBox" id="plugins_tree_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
+ <placeholder/>
</child>
</widget>
<packing>
@@ -74,8 +59,8 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox4">
- <property name="height_request">50</property>
+ <widget class="GtkHBox" id="header_hbox">
+ <property name="height_request">64</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
--- rhythmbox/plugins/rb-plugin-manager.c 2007-02-15 22:29:36.000000000 +0100
+++ rb2/plugins/rb-plugin-manager.c 2007-02-11 17:36:24.000000000 +0100
@@ -60,6 +60,7 @@
GtkWidget *copyright_label;
GtkWidget *authors_label;
GtkWidget *description_label;
+ GtkWidget *header_hbox;
GtkWidget *plugin_icon;
GtkWidget *site_text;
GtkWidget *copyright_text;
@@ -176,8 +177,29 @@
gtk_label_set_text (GTK_LABEL (pm->priv->authors_text), string);
g_free (string);
- gtk_image_set_from_pixbuf (GTK_IMAGE (pm->priv->plugin_icon),
- rb_plugins_engine_get_plugin_icon (info));
+ { /* plugin icon */
+ GdkPixbuf *icon = rb_plugins_engine_get_plugin_icon (info);
+ if (icon != NULL) {
+ GdkPixbuf *icon_scaled;
+ gint width, height, header_height;
+
+ width = gdk_pixbuf_get_width (icon);
+ height = gdk_pixbuf_get_height (icon);
+ header_height = pm->priv->header_hbox->allocation.height;
+ if (height > header_height) { /* resize to fit */
+ icon_scaled = gdk_pixbuf_scale_simple (icon,
+ (gfloat)width/height*header_height, header_height,
+ GDK_INTERP_BILINEAR);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (pm->priv->plugin_icon), icon_scaled);
+ g_object_unref (G_OBJECT (icon_scaled));
+ } else {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (pm->priv->plugin_icon), icon);
+ }
+
+ } else {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (pm->priv->plugin_icon), NULL);
+ }
+ }
gtk_widget_set_sensitive (GTK_WIDGET (pm->priv->configure_button),
(info != NULL) &&
@@ -445,7 +467,7 @@
rb_plugin_manager_init (RBPluginManager *pm)
{
GladeXML *xml;
- GtkWidget *plugins_tree_vbox;
+ GtkWidget *plugins_window;
pm->priv = RB_PLUGIN_MANAGER_GET_PRIVATE (pm);
@@ -457,8 +479,8 @@
gtk_box_set_spacing (GTK_BOX (pm), 6);
pm->priv->tree = gtk_tree_view_new ();
- plugins_tree_vbox = glade_xml_get_widget (xml, "plugins_tree_vbox");
- gtk_container_add (GTK_CONTAINER (plugins_tree_vbox), pm->priv->tree);
+ plugins_window = glade_xml_get_widget (xml, "plugins_scrolledwindow");
+ gtk_container_add (GTK_CONTAINER (plugins_window), pm->priv->tree);
pm->priv->configure_button = glade_xml_get_widget (xml, "configure_button");
g_signal_connect (pm->priv->configure_button,
@@ -466,6 +488,8 @@
G_CALLBACK (configure_button_cb),
pm);
+ pm->priv->header_hbox = glade_xml_get_widget (xml, "header_hbox");
+
pm->priv->plugin_title = glade_xml_get_widget (xml, "plugin_title");
pm->priv->site_label = glade_xml_get_widget (xml, "site_label");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]