brasero r1165 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1165 - in trunk: . src
- Date: Mon, 25 Aug 2008 07:24:06 +0000 (UTC)
Author: philippr
Date: Mon Aug 25 07:24:05 2008
New Revision: 1165
URL: http://svn.gnome.org/viewvc/brasero?rev=1165&view=rev
Log:
Added a button to set background image/color to the toolbar in the
cover editor
* src/brasero-jacket-background.c (brasero_jacket_background_init):
* src/brasero-jacket-edit.c
(brasero_jacket_edit_configure_background_pressed_cb),
(brasero_jacket_edit_update_button_state),
(brasero_jacket_edit_init):
* src/brasero-jacket-view.c
(brasero_jacket_view_configure_background),
(brasero_jacket_view_change_image_activated_cb):
* src/brasero-jacket-view.h:
Modified:
trunk/ChangeLog
trunk/src/brasero-jacket-background.c
trunk/src/brasero-jacket-edit.c
trunk/src/brasero-jacket-view.c
trunk/src/brasero-jacket-view.h
Modified: trunk/src/brasero-jacket-background.c
==============================================================================
--- trunk/src/brasero-jacket-background.c (original)
+++ trunk/src/brasero-jacket-background.c Mon Aug 25 07:24:05 2008
@@ -179,6 +179,50 @@
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), vbox, TRUE, TRUE, 0);
+ label = gtk_label_new_with_mnemonic (_("<b>_Color</b>"));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
+
+ label = gtk_label_new ("\t");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+
+ vbox2 = gtk_vbox_new (FALSE, 6);
+ gtk_widget_show (vbox2);
+ gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, TRUE, 0);
+
+ hbox2 = gtk_hbox_new (FALSE, 12);
+ gtk_widget_show (hbox2);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, TRUE, 0);
+
+ combo = gtk_combo_box_new_text ();
+ priv->color_style = combo;
+ gtk_widget_show (combo);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Solid color"));
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Horizontal gradient"));
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Vertical gradient"));
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
+ gtk_box_pack_start (GTK_BOX (hbox2), combo, FALSE, TRUE, 0);
+ g_signal_connect (combo,
+ "changed",
+ G_CALLBACK (brasero_jacket_background_color_type_changed_cb),
+ object);
+
+ priv->color = gtk_color_button_new ();
+ gtk_widget_show (priv->color);
+ gtk_box_pack_start (GTK_BOX (hbox2), priv->color, FALSE, TRUE, 0);
+
+ priv->color2 = gtk_color_button_new ();
+ gtk_box_pack_start (GTK_BOX (hbox2), priv->color2, FALSE, TRUE, 0);
+
+
label = gtk_label_new_with_mnemonic (_("<b>_Image</b>"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
@@ -229,49 +273,6 @@
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_box_pack_start (GTK_BOX (hbox2), combo, FALSE, TRUE, 0);
- label = gtk_label_new_with_mnemonic (_("<b>_Color</b>"));
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
-
- label = gtk_label_new ("\t");
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
-
- vbox2 = gtk_vbox_new (FALSE, 6);
- gtk_widget_show (vbox2);
- gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, TRUE, 0);
-
- hbox2 = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (hbox2);
- gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, TRUE, 0);
-
- combo = gtk_combo_box_new_text ();
- priv->color_style = combo;
- gtk_widget_show (combo);
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Solid color"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Horizontal gradient"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Vertical gradient"));
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
- gtk_box_pack_start (GTK_BOX (hbox2), combo, FALSE, TRUE, 0);
- g_signal_connect (combo,
- "changed",
- G_CALLBACK (brasero_jacket_background_color_type_changed_cb),
- object);
-
- priv->color = gtk_color_button_new ();
- gtk_widget_show (priv->color);
- gtk_box_pack_start (GTK_BOX (hbox2), priv->color, FALSE, TRUE, 0);
-
- priv->color2 = gtk_color_button_new ();
- gtk_box_pack_start (GTK_BOX (hbox2), priv->color2, FALSE, TRUE, 0);
-
gtk_dialog_add_button (GTK_DIALOG (object),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
Modified: trunk/src/brasero-jacket-edit.c
==============================================================================
--- trunk/src/brasero-jacket-edit.c (original)
+++ trunk/src/brasero-jacket-edit.c Mon Aug 25 07:24:05 2008
@@ -54,6 +54,8 @@
GtkWidget *underline;
GtkWidget *italic;
GtkWidget *bold;
+
+ GtkWidget *background;
};
#define BRASERO_JACKET_EDIT_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_JACKET_EDIT, BraseroJacketEditPrivate))
@@ -383,6 +385,17 @@
}
static void
+brasero_jacket_edit_configure_background_pressed_cb (GtkToolButton *button,
+ BraseroJacketEdit *self)
+{
+ BraseroJacketEditPrivate *priv;
+
+ priv = BRASERO_JACKET_EDIT_PRIVATE (self);
+ if (priv->current_view)
+ brasero_jacket_view_configure_background (BRASERO_JACKET_VIEW (priv->current_view));
+}
+
+static void
brasero_jacket_edit_update_button_state (BraseroJacketEdit *self)
{
gint pos;
@@ -394,10 +407,14 @@
priv = BRASERO_JACKET_EDIT_PRIVATE (self);
- if (priv->current_view)
+ if (priv->current_view) {
buffer = brasero_jacket_view_get_active_buffer (BRASERO_JACKET_VIEW (priv->current_view));
- else
+ gtk_widget_set_sensitive (priv->background, TRUE);
+ }
+ else {
buffer = NULL;
+ gtk_widget_set_sensitive (priv->background, FALSE);
+ }
if (!buffer)
return;
@@ -528,6 +545,16 @@
object);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item), 0);
+ item = GTK_WIDGET (gtk_tool_button_new_from_stock (GTK_STOCK_SELECT_COLOR));
+ gtk_widget_show (item);
+ gtk_widget_set_sensitive (item, FALSE);
+ g_signal_connect (item,
+ "clicked",
+ G_CALLBACK (brasero_jacket_edit_configure_background_pressed_cb),
+ object);
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (item), 0);
+ priv->background = item;
+
item = GTK_WIDGET (gtk_radio_tool_button_new_from_stock (NULL, GTK_STOCK_JUSTIFY_RIGHT));
gtk_widget_show (item);
g_signal_connect (item,
Modified: trunk/src/brasero-jacket-view.c
==============================================================================
--- trunk/src/brasero-jacket-view.c (original)
+++ trunk/src/brasero-jacket-view.c Mon Aug 25 07:24:05 2008
@@ -664,9 +664,8 @@
gtk_adjustment_set_value (adj, 0.0);
}
-static void
-brasero_jacket_view_change_image_activated_cb (GtkMenuItem *item,
- BraseroJacketView *self)
+void
+brasero_jacket_view_configure_background (BraseroJacketView *self)
{
BraseroJacketImageStyle image_style;
BraseroJacketColorStyle color_style;
@@ -705,6 +704,13 @@
}
static void
+brasero_jacket_view_change_image_activated_cb (GtkMenuItem *item,
+ BraseroJacketView *self)
+{
+ brasero_jacket_view_configure_background (self);
+}
+
+static void
brasero_jacket_view_populate_popup_cb (GtkTextView *view,
GtkMenu *menu,
BraseroJacketView *self)
Modified: trunk/src/brasero-jacket-view.h
==============================================================================
--- trunk/src/brasero-jacket-view.h (original)
+++ trunk/src/brasero-jacket-view.h Mon Aug 25 07:24:05 2008
@@ -101,6 +101,9 @@
brasero_jacket_view_set_image (BraseroJacketView *view,
const gchar *path);
+void
+brasero_jacket_view_configure_background (BraseroJacketView *view);
+
guint
brasero_jacket_view_print (BraseroJacketView *view,
GtkPrintContext *context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]