Attempt to fix problem with tab close button size.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1925 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-10-02 14:23:11 +00:00
parent ddaadcf359
commit f6c3430623
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2007-10-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/notebook.c:
Attempt to fix problem with tab close button size.
2007-10-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/document.c: Fix scrolling bugs when searching text and the cursor

View File

@ -323,6 +323,8 @@ gint notebook_new_tab(gint doc_idx)
if (prefs.show_tab_cross)
{
GtkWidget *image, *btn, *align;
GtkRcStyle *rcstyle;
GtkRequisition size;
btn = gtk_button_new();
gtk_button_set_relief(GTK_BUTTON(btn), GTK_RELIEF_NONE);
@ -330,10 +332,16 @@ gint notebook_new_tab(gint doc_idx)
/* don't allow focus on the close button */
gtk_button_set_focus_on_click(GTK_BUTTON(btn), FALSE);
/* make it as small as possible */
rcstyle = gtk_rc_style_new();
rcstyle->xthickness = rcstyle->ythickness = 0;
gtk_widget_modify_style(btn, rcstyle);
gtk_rc_style_unref(rcstyle);
image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
gtk_widget_size_request(image, &size);
gtk_widget_set_size_request(btn, size.width, size.height);
gtk_container_add(GTK_CONTAINER(btn), image);
gtk_container_set_border_width(GTK_CONTAINER(btn), 0);
gtk_widget_set_size_request(btn, 19, 18);
align = gtk_alignment_new(1.0, 0.0, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(align), btn);