Re: [Anjuta-devel] Re: [Anjuta-list] Some not-perfect things in anjuta
- From: Johannes Schmid <johannes schmid gmx de>
- To: Günther Brammer <GBrammer gmx de>
- Cc: Anjuta Developer Mailing List <anjuta-devel lists sourceforge net>, Anjuta <anjuta-list lists sourceforge net>
- Subject: Re: [Anjuta-devel] Re: [Anjuta-list] Some not-perfect things in anjuta
- Date: Thu May 18 11:55:08 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Günther!
That's great! I applied the patch to CVS and added some nice file-type
icons to the tabs, too! I does now even look better than gedit!
Thanks,
Johannes
Günther Brammer schrieb:
> Am Donnerstag, den 18.05.2006, 16:53 +0200 schrieb Johannes Schmid:
>> About the tabs: The problem is that the rather widespread clearlooks
>> theme puts a border around every pixmap. As we use the GTK_STOCK_CLOSE
>> pixmap for the editor tabs and don't want to cut-off the edges of the
>> icon (like gedit) the tabs grow quite large. Anyway, we may need to use
>> another icon in the future. What about the gdl closing icon?
>
> I didn't like those big closebuttons, too, so I copied some code from
> Galeon to make them smaller without cutting the pixmap.
>
> Günther
>
>
> ------------------------------------------------------------------------
>
> Index: plugins/document-manager/anjuta-docman.c
> ===================================================================
> RCS file: /cvs/gnome/anjuta/plugins/document-manager/anjuta-docman.c,v
> retrieving revision 1.52
> diff -u -r1.52 anjuta-docman.c
> --- plugins/document-manager/anjuta-docman.c 17 May 2006 15:36:45 -0000 1.52
> +++ plugins/document-manager/anjuta-docman.c 18 May 2006 17:31:22 -0000
> @@ -494,9 +494,10 @@
> static GtkWidget*
> editor_tab_widget_new(AnjutaDocmanPage* page, AnjutaDocman* docman)
> {
> - GtkWidget *button15;
> + GtkWidget *close_button;
> GtkWidget *close_pixmap;
> GtkWidget *tmp_toolbar_icon;
> + GtkRcStyle *rcstyle;
> GtkWidget *label, *menu_label;
> GtkWidget *box;
> GtkWidget *event_hbox;
> @@ -514,14 +515,18 @@
> tmp_toolbar_icon = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
> gtk_widget_show(tmp_toolbar_icon);
>
> - button15 = gtk_button_new();
> - gtk_container_add(GTK_CONTAINER(button15), tmp_toolbar_icon);
> - gtk_button_set_relief(GTK_BUTTON(button15), GTK_RELIEF_NONE);
> -
> - /* Setting size creates awkard looking cross button. Let the widget
> - * size itself
> - */
> - /* gtk_widget_set_size_request (button15, w, h); */
> + /* setup close button, zero out {x,y}thickness to get smallest possible
> + * size */
> + close_button = gtk_button_new();
> + gtk_button_set_focus_on_click (GTK_BUTTON (close_button), FALSE);
> + gtk_container_add(GTK_CONTAINER(close_button), tmp_toolbar_icon);
> + gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE);
> + rcstyle = gtk_rc_style_new ();
> + rcstyle->xthickness = rcstyle->ythickness = 0;
> + gtk_widget_modify_style (close_button, rcstyle);
> + gtk_rc_style_unref (rcstyle);
> +
> + gtk_widget_set_size_request (close_button, w, h);
>
> close_pixmap = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
> gtk_widget_set_size_request(close_pixmap, w,h);
> @@ -539,12 +544,12 @@
> color.green = 0;
> color.blue = 0;
>
> - gtk_widget_modify_fg (button15, GTK_STATE_NORMAL, &color);
> - gtk_widget_modify_fg (button15, GTK_STATE_INSENSITIVE, &color);
> - gtk_widget_modify_fg (button15, GTK_STATE_ACTIVE, &color);
> - gtk_widget_modify_fg (button15, GTK_STATE_PRELIGHT, &color);
> - gtk_widget_modify_fg (button15, GTK_STATE_SELECTED, &color);
> - gtk_widget_show(button15);
> + gtk_widget_modify_fg (close_button, GTK_STATE_NORMAL, &color);
> + gtk_widget_modify_fg (close_button, GTK_STATE_INSENSITIVE, &color);
> + gtk_widget_modify_fg (close_button, GTK_STATE_ACTIVE, &color);
> + gtk_widget_modify_fg (close_button, GTK_STATE_PRELIGHT, &color);
> + gtk_widget_modify_fg (close_button, GTK_STATE_SELECTED, &color);
> + gtk_widget_show(close_button);
>
> /* create our layout/event boxes */
> event_box = gtk_event_box_new();
> @@ -554,7 +559,7 @@
> box = gtk_hbox_new(FALSE, 2);
>
> gtk_box_pack_start (GTK_BOX(event_hbox), label, TRUE, TRUE, 0);
> - gtk_box_pack_start (GTK_BOX (event_hbox), button15, FALSE, FALSE, 0);
> + gtk_box_pack_start (GTK_BOX (event_hbox), close_button, FALSE, FALSE, 0);
> gtk_box_pack_start (GTK_BOX(event_hbox), close_pixmap, FALSE, FALSE, 0);
> gtk_container_add (GTK_CONTAINER (event_box), event_hbox);
>
> @@ -567,12 +572,12 @@
> /* show the widgets of the tab */
> gtk_widget_show_all(box);
>
> - gtk_signal_connect (GTK_OBJECT (button15), "clicked",
> + gtk_signal_connect (GTK_OBJECT (close_button), "clicked",
> GTK_SIGNAL_FUNC(on_text_editor_notebook_close_page),
> docman);
>
> page->close_image = close_pixmap;
> - page->close_button = button15;
> + page->close_button = close_button;
> page->label = label;
> page->menu_label = menu_label;
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEbMLk7Dsf+G5b/WsRArE5AJ9mk8+EhcQ31UA/9w3LzJD8XXTLoACfUtEK
7gQNK1DpLeYsW4SehNW+P7w=
=Q9r9
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]