change the table with the widgets to a vertical box, where each widget

24-02-07  Joaquin Cuenca Abela  <e98cuenc@yahoo.com>

	* src/glade-palette.c: change the table with the widgets
	to a vertical box, where each widget lies in a row
	(the icon of the widget next to its label).
	* src/glade-project-window.c: make the palette resizable.
	* src/glade-widget-class.c: load png files instead of xpm
	files for the icons of the widgets.
	* widgets/glade-palette.xml, gtk-base.xml, gtk-additional.xml,
	gtk-dialogs.xml, gtk-obsolete.xml: Change the layout of the
	palette.
	* pixmaps/*.png: 24bpp alpha blended icons for the widgets.
	Most of them come from the jimmac collection.
This commit is contained in:
Joaquin Cuenca Abela 2004-02-07 10:45:47 +00:00 committed by Joaquín Cuenca Abela
parent 1617ccd5cf
commit 19e014d7ff
58 changed files with 163 additions and 111 deletions

View File

@ -1,3 +1,17 @@
2004-02-07 Joaquin Cuenca Abela <e98cuenc@yahoo.com>
* src/glade-palette.c: change the table with the widgets
to a vertical box, where each widget lies in a row
(the icon of the widget next to its label).
* src/glade-project-window.c: make the palette resizable.
* src/glade-widget-class.c: load png files instead of xpm
files for the icons of the widgets.
* widgets/glade-palette.xml, gtk-base.xml, gtk-additional.xml,
gtk-dialogs.xml, gtk-obsolete.xml: Change the layout of the
palette.
* pixmaps/*.png: 24bpp alpha blended icons for the widgets.
Most of them come from the jimmac collection.
2004-02-01 Paolo Borelli <pborelli@katamail.com>
* src/glade-project-view.c: use gtk_window_present instead of

View File

@ -1,61 +1,50 @@
pixmaps_DATA = \
window.xpm \
button.xpm \
checkbutton.xpm \
custom.xpm \
dialog.xpm \
vbox.xpm \
hbox.xpm \
label.xpm \
table.xpm \
entry.xpm \
notebook.xpm \
togglebutton.xpm \
spinbutton.xpm \
radiobutton.xpm \
progressbar.xpm \
frame.xpm \
combo.xpm \
hseparator.xpm \
vseparator.xpm \
handlebox.xpm \
optionmenu.xpm \
selector.xpm \
placeholder.xpm \
accellabel.xpm \
alignment.xpm \
arrow.xpm \
aspectframe.xpm \
calendar.xpm \
colorselection.xpm \
colorselectiondialog.xpm \
curve.xpm \
drawingarea.xpm \
eventbox.xpm \
fileselection.xpm \
fixed.xpm \
fontselection.xpm \
fontselectiondialog.xpm \
gammacurve.xpm \
hbuttonbox.xpm \
hpaned.xpm \
hruler.xpm \
hscale.xpm \
hscrollbar.xpm \
image.xpm \
inputdialog.xpm \
layout.xpm \
menubar.xpm \
scrolledwindow.xpm \
statusbar.xpm \
textview.xpm \
toolbar.xpm \
treeview.xpm \
vbuttonbox.xpm \
viewport.xpm \
vpaned.xpm \
vruler.xpm \
vscale.xpm \
vscrollbar.xpm
accellabel.png \
arrow.png \
button.png \
calendar.png \
checkbutton.png \
colorselection.png \
colorselectiondialog.png \
combo.png \
curve.png \
dialog.png \
drawingarea.png \
entry.png \
fileselection.png \
fontselection.png \
fontselectiondialog.png \
frame.png \
gammacurve.png \
handlebox.png \
hbox.png \
hbuttonbox.png \
hpaned.png \
hruler.png \
hscrollbar.png \
hseparator.png \
image.png \
inputdialog.png \
label.png \
menubar.png \
messagedialog.png \
notebook.png \
optionmenu.png \
radiobutton.png \
scrolledwindow.png \
selector.png \
spinbutton.png \
table.png \
textview.png \
togglebutton.png \
toolbar.png \
treeview.png \
vbox.png \
vbuttonbox.png \
vpaned.png \
vruler.png \
vscrollbar.png \
vseparator.png \
window.png
EXTRA_DIST = $(pixmaps_DATA)

BIN
pixmaps/accellabel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

BIN
pixmaps/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

BIN
pixmaps/button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

BIN
pixmaps/calendar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
pixmaps/checkbutton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

BIN
pixmaps/colorselection.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pixmaps/combo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

BIN
pixmaps/curve.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

BIN
pixmaps/dialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

BIN
pixmaps/drawingarea.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

BIN
pixmaps/entry.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
pixmaps/fileselection.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pixmaps/fontselection.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

BIN
pixmaps/frame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

BIN
pixmaps/gammacurve.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

BIN
pixmaps/handlebox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

BIN
pixmaps/hbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

BIN
pixmaps/hbuttonbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
pixmaps/hpaned.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
pixmaps/hruler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

BIN
pixmaps/hscrollbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

BIN
pixmaps/hseparator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

BIN
pixmaps/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

BIN
pixmaps/inputdialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pixmaps/label.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

BIN
pixmaps/menubar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

BIN
pixmaps/messagedialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

BIN
pixmaps/notebook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

BIN
pixmaps/optionmenu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

BIN
pixmaps/radiobutton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

BIN
pixmaps/scrolledwindow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

BIN
pixmaps/selector.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

BIN
pixmaps/spinbutton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

BIN
pixmaps/table.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
pixmaps/textview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

BIN
pixmaps/togglebutton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

BIN
pixmaps/toolbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

BIN
pixmaps/treeview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

BIN
pixmaps/vbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

BIN
pixmaps/vbuttonbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

BIN
pixmaps/vpaned.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

BIN
pixmaps/vruler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

BIN
pixmaps/vscrollbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

BIN
pixmaps/vseparator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

BIN
pixmaps/window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -26,7 +26,7 @@
#endif
#ifndef PIXMAPS_DIR
#define PIXMAPS_DIR "C:/Program Files/glade/pixmap"
#define PIXMAPS_DIR "E:/Programmation/Glade/msvc6/pixmaps"
#endif
#include "glade.h"
@ -140,7 +140,8 @@ glade_palette_selector_new (GladePalette *palette)
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (palette->selector), FALSE);
palette->widgets_button_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (palette->selector));
gtk_button_set_relief (GTK_BUTTON (palette->selector), GTK_RELIEF_NONE);
image = gtk_image_new_from_file (PIXMAPS_DIR "/selector.xpm");
image = gtk_image_new_from_file (PIXMAPS_DIR "/selector.png");
gtk_container_add (GTK_CONTAINER (palette->selector), image);
glade_util_widget_set_tooltip (palette->selector, _("Selector"));
@ -149,9 +150,10 @@ glade_palette_selector_new (GladePalette *palette)
/* the label defaults to "Selector" */
palette->label = gtk_label_new (_("Selector"));
gtk_misc_set_alignment (GTK_MISC (palette->label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), palette->selector, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), palette->label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), palette->label, TRUE, TRUE, 2);
gtk_widget_show_all (hbox);
@ -202,36 +204,65 @@ glade_palette_attach_icon (GladePalette *palette,
static GtkWidget *
glade_palette_widget_table_create (GladePalette *palette, GladeCatalog *catalog)
{
GtkWidget *table;
GList *list;
gint num = 0;
gint num_visible = 0;
gint visual_pos = 0;
gint rows;
gint cols = 4;
gint i;
GtkVBox *vbox;
GtkHBox *hbox;
GtkLabel *label;
GtkRadioButton *radio;
GtkScrolledWindow *scrolled_window;
int nb_rows = 0;
int row = 0;
list = glade_catalog_get_widget_classes (catalog);
while (list)
{
if (((GladeWidgetClass*) list->data)->in_palette)
++num_visible;
GladeWidgetClass *widget_class = (GladeWidgetClass*) list->data;
if (widget_class->in_palette)
nb_rows++;
list = list->next;
}
vbox = GTK_VBOX (gtk_vbox_new (FALSE, 0));
list = glade_catalog_get_widget_classes (catalog);
while (list)
{
GladeWidgetClass *widget_class = (GladeWidgetClass*) list->data;
if (widget_class->in_palette)
{
label = GTK_LABEL (gtk_label_new (widget_class->generic_name));
radio = GTK_RADIO_BUTTON (gtk_radio_button_new (palette->widgets_button_group));
num = g_list_length (list);
rows = (gint)((num_visible - 1)/ cols) + 1;
g_object_set_data (G_OBJECT (radio), "user", list->data);
palette->widgets_button_group = gtk_radio_button_get_group (radio);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radio), FALSE);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
table = gtk_table_new (rows, cols, TRUE);
hbox = GTK_HBOX (gtk_hbox_new (FALSE, 2));
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (widget_class->icon), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (label), TRUE, TRUE, 1);
for (i = 0; i < num; i++)
if (glade_palette_attach_icon (palette, table, list, i, visual_pos, cols))
++visual_pos;
gtk_button_set_relief (GTK_BUTTON (radio), GTK_RELIEF_NONE);
gtk_container_add (GTK_CONTAINER (radio), GTK_WIDGET (hbox));
return table;
g_signal_connect (G_OBJECT (radio), "toggled",
G_CALLBACK (glade_palette_on_button_toggled), palette);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (radio), FALSE, FALSE, 0);
row++;
}
list = list->next;
}
scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (scrolled_window, GTK_WIDGET (vbox));
gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_NONE);
gtk_widget_set_size_request (GTK_WIDGET (scrolled_window), -1, 400);
return GTK_WIDGET (scrolled_window);
}
static void
@ -246,7 +277,7 @@ glade_palette_init (GladePalette *palette)
/* Selector */
selector_hbox = glade_palette_selector_new (palette);
gtk_box_pack_start (GTK_BOX (palette), selector_hbox, FALSE, TRUE, 3);
gtk_box_pack_start (GTK_BOX (palette), selector_hbox, FALSE, TRUE, 0);
/* Separator */
widget = gtk_hseparator_new ();
@ -264,7 +295,7 @@ glade_palette_init (GladePalette *palette)
palette->notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (palette->notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (palette->notebook), FALSE);
gtk_box_pack_end (GTK_BOX (palette), palette->notebook, FALSE, TRUE, 3);
gtk_box_pack_end (GTK_BOX (palette), palette->notebook, TRUE, TRUE, 0);
palette->nb_sections = 0;
}
@ -301,7 +332,7 @@ glade_palette_append_catalog (GladePalette *palette, GladeCatalog *catalog)
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (glade_palette_on_catalog_button_toggled),
palette);
gtk_box_pack_start (GTK_BOX (palette->groups_vbox), button, FALSE, TRUE, 3);
gtk_box_pack_start (GTK_BOX (palette->groups_vbox), button, FALSE, TRUE, 0);
/* Add the section */
widget = glade_palette_widget_table_create (palette, catalog);

View File

@ -562,7 +562,7 @@ gpw_create_palette (GladeProjectWindow *gpw)
gtk_window_set_title (gpw->palette_window, _("Palette"));
gtk_window_set_type_hint (gpw->palette_window, GDK_WINDOW_TYPE_HINT_UTILITY);
gtk_window_set_resizable (gpw->palette_window, FALSE);
gtk_window_set_resizable (gpw->palette_window, TRUE);
gtk_container_add (GTK_CONTAINER (gpw->palette_window), GTK_WIDGET (gpw->palette));

View File

@ -249,7 +249,7 @@ glade_widget_class_create_icon (GladeWidgetClass *class)
GtkWidget *icon;
gchar *icon_path;
icon_path = g_strdup_printf (PIXMAPS_DIR "/%s.xpm", class->generic_name);
icon_path = g_strdup_printf (PIXMAPS_DIR "/%s.png", class->generic_name);
icon = gtk_image_new_from_file (icon_path);
g_free (icon_path);

View File

@ -1,7 +1,9 @@
catalogs_DATA = \
glade-palette.xml \
gtk-base.xml \
gtk-additional.xml
gtk-additional.xml \
gtk-dialogs.xml \
gtk-obsolete.xml
widgets_DATA = \
gtkaccellabel.xml \

View File

@ -1,4 +1,6 @@
<GladePalette>
<GladeCatalog filename="gtk-base.xml"/>
<GladeCatalog filename="gtk-additional.xml"/>
<GladeCatalog filename="gtk-dialogs.xml"/>
<GladeCatalog filename="gtk-obsolete.xml"/>
</GladePalette>

View File

@ -2,28 +2,30 @@
<GladeWidget name="GtkHScale" generic_name="hscale"/>
<GladeWidget name="GtkVScale" generic_name="vscale"/>
<GladeWidget name="GtkHRuler" generic_name="hruler"/>
<GladeWidget name="GtkVRuler" generic_name="vruler"/>
<GladeWidget name="GtkAlignment" generic_name="alignment"/>
<GladeWidget name="GtkEventBox" generic_name="eventbox"/>
<GladeWidget name="GtkCalendar" generic_name="calendar"/>
<GladeWidget name="GtkAspectFrame" generic_name="aspectframe"/>
<GladeWidget name="GtkMenu" generic_name="menu"/>
<GladeWidget name="GtkCurve" generic_name="curve"/>
<GladeWidget name="GtkGammaCurve" generic_name="gammacurve"/>
<GladeWidget name="GtkHScrollbar" generic_name="hscrollbar"/>
<GladeWidget name="GtkVScrollbar" generic_name="vscrollbar"/>
<GladeWidget name="GtkColorSelection" generic_name="colorselection"/>
<GladeWidget name="GtkFontSelection" generic_name="fontselection"/>
<GladeWidget name="GtkHButtonBox" generic_name="hbuttonbox"/>
<GladeWidget name="GtkVButtonBox" generic_name="vbuttonbox"/>
<GladeWidget name="GtkHSeparator" generic_name="hseparator"/>
<GladeWidget name="GtkVSeparator" generic_name="vseparator"/>
<GladeWidget name="GtkOptionMenu" generic_name="optionmenu"/>
<GladeWidget name="GtkStatusbar" generic_name="statusbar" filename="gtkstatusbar.xml"/>
<GladeWidget name="GtkInputDialog" generic_name="inputdialog"/>
<GladeWidget name="GtkArrow" generic_name="arrow"/>
<GladeWidget name="GtkLayout" generic_name="layout"/>
<GladeWidget name="GtkFixed" generic_name="fixed"/>
<GladeWidget name="GtkDrawingArea" generic_name="drawingarea"/>
<GladeWidget name="GtkViewport" generic_name="viewport"/>
<GladeWidget name="GtkScrolledWindow" generic_name="scrolledwindow"/>
<!-- NOT AVAILABLES ON WIN32
<GladeWidget name="GtkPlug" generic_name="plug"/>
<GladeWidget name="GtkSocket" generic_name="socket"/>

View File

@ -1,4 +1,4 @@
<GladeCatalog Title="Gtk+ Basic" library="gladegtk">
<GladeCatalog Title="Gtk+ Base" library="gladegtk">
<GladeWidget name="GtkWidget" filename="gtkwidget.xml"/>
<GladeWidget name="GtkContainer" filename="gtkcontainer.xml"/>
@ -26,35 +26,20 @@
<GladeWidget name="GtkTreeView" generic_name="treeview"/>
<GladeWidget name="GtkCombo" generic_name="combo"/>
<GladeWidget name="GtkOptionMenu" generic_name="optionmenu"/>
<GladeWidget name="GtkProgressBar" generic_name="progressbar"/>
<GladeWidget name="GtkStatusbar" generic_name="statusbar" filename="gtkstatusbar.xml"/>
<GladeWidget name="GtkImage" generic_name="image"/>
<GladeWidget name="GtkDrawingArea" generic_name="drawingarea"/>
<GladeWidget name="GtkDialog" generic_name="dialog" filename="gtkdialog.xml"/>
<GladeWidget name="GtkMessageDialog" generic_name="messagedialog" filename="gtkmessagedialog.xml"/>
<GladeWidget name="GtkFileSelection" generic_name="fileselection"/>
<GladeWidget name="GtkColorSelectionDialog" generic_name="colorselectiondialog"/>
<GladeWidget name="GtkFontSelectionDialog" generic_name="fontselectiondialog"/>
<GladeWidget name="GtkHBox" generic_name="hbox"/>
<GladeWidget name="GtkVBox" generic_name="vbox"/>
<GladeWidget name="GtkTable" generic_name="table" filename="gtktable.xml"/>
<GladeWidget name="GtkFixed" generic_name="fixed"/>
<GladeWidget name="GtkHSeparator" generic_name="hseparator"/>
<GladeWidget name="GtkVSeparator" generic_name="vseparator"/>
<GladeWidget name="GtkHButtonBox" generic_name="hbuttonbox"/>
<GladeWidget name="GtkVButtonBox" generic_name="vbuttonbox"/>
<GladeWidget name="GtkHPaned" generic_name="hpaned"/>
<GladeWidget name="GtkVPaned" generic_name="vpaned"/>
<GladeWidget name="GtkNotebook" generic_name="notebook" filename="gtknotebook.xml"/>
<GladeWidget name="GtkFrame" generic_name="frame"/>
<GladeWidget name="GtkScrolledWindow" generic_name="scrolledwindow"/>
<GladeWidget name="GtkViewport" generic_name="viewport"/>
</GladeCatalog>

9
widgets/gtk-dialogs.xml Normal file
View File

@ -0,0 +1,9 @@
<GladeCatalog Title="Gtk+ Standard Dialogs" library="gladegtk">
<GladeWidget name="GtkColorSelectionDialog" generic_name="colorselectiondialog"/>
<GladeWidget name="GtkFileSelection" generic_name="fileselection"/>
<GladeWidget name="GtkFontSelectionDialog" generic_name="fontselectiondialog"/>
<GladeWidget name="GtkInputDialog" generic_name="inputdialog"/>
<GladeWidget name="GtkMessageDialog" generic_name="messagedialog" filename="gtkmessagedialog.xml"/>
</GladeCatalog>

18
widgets/gtk-obsolete.xml Normal file
View File

@ -0,0 +1,18 @@
<GladeCatalog Title="Gtk+ Obsolete" library="gladegtk">
<GladeWidget name="GtkRuler" filename="gtkruler.xml"/>
<GladeWidget name="GtkHRuler" generic_name="hruler"/>
<GladeWidget name="GtkVRuler" generic_name="vruler"/>
<GladeWidget name="GtkColorSelection" generic_name="colorselection"/>
<GladeWidget name="GtkFontSelection" generic_name="fontselection"/>
<GladeWidget name="GtkCurve" generic_name="curve"/>
<GladeWidget name="GtkGammaCurve" generic_name="gammacurve"/>
<!-- NOT AVAILABLES ON WIN32
<GladeWidget name="GtkPlug" generic_name="plug"/>
<GladeWidget name="GtkSocket" generic_name="socket"/>
-->
</GladeCatalog>