app/widgets/gimpbrushfactoryview.[ch] app/widgets/gimpbufferview.[ch]

2003-04-08  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpbrushfactoryview.[ch]
	* app/widgets/gimpbufferview.[ch]
	* app/widgets/gimpcontainereditor.[ch]
	* app/widgets/gimpcontainergridview.[ch]
	* app/widgets/gimpcontainertreeview.[ch]
	* app/widgets/gimpcontainerview.[ch]
	* app/widgets/gimpdatafactoryview.[ch]
	* app/widgets/gimpdocumentview.[ch]
	* app/widgets/gimpimageview.[ch]
	* app/widgets/gimpitemtreeview.[ch]
	* app/widgets/gimptemplateview.[ch]: removed "min_item_x" and
	"min_item_y" parameters all over the place. Added
	"preview_border_width" instead.

	* app/widgets/gimpmenuitem.c: ensure that all menu items have the
	same height.

	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpundoeditor.c
	* app/gui/brush-select.c
	* app/gui/dialogs-commands.c
	* app/gui/dialogs-constructors.c
	* app/gui/font-select.c
	* app/gui/gradient-select.c
	* app/gui/palette-select.c
	* app/gui/pattern-select.c: changed accordingly.

	* app/gui/dialogs-constructors.c: removed the borders from the tool
	and template lists.
This commit is contained in:
Michael Natterer 2003-04-08 12:39:02 +00:00 committed by Michael Natterer
parent 5797c03295
commit f20e559bbf
36 changed files with 224 additions and 232 deletions

View File

@ -1,3 +1,36 @@
2003-04-08 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpbrushfactoryview.[ch]
* app/widgets/gimpbufferview.[ch]
* app/widgets/gimpcontainereditor.[ch]
* app/widgets/gimpcontainergridview.[ch]
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpcontainerview.[ch]
* app/widgets/gimpdatafactoryview.[ch]
* app/widgets/gimpdocumentview.[ch]
* app/widgets/gimpimageview.[ch]
* app/widgets/gimpitemtreeview.[ch]
* app/widgets/gimptemplateview.[ch]: removed "min_item_x" and
"min_item_y" parameters all over the place. Added
"preview_border_width" instead.
* app/widgets/gimpmenuitem.c: ensure that all menu items have the
same height.
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpundoeditor.c
* app/gui/brush-select.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/font-select.c
* app/gui/gradient-select.c
* app/gui/palette-select.c
* app/gui/pattern-select.c: changed accordingly.
* app/gui/dialogs-constructors.c: removed the borders from the tool
and template lists.
2003-04-08 Michael Natterer <mitch@gimp.org>
* app/config/gimpguiconfig.[ch]

View File

@ -253,7 +253,8 @@ dialogs_preview_size_cmd_callback (GtkWidget *widget,
view = gimp_container_view_get_by_dockable (dockable);
if (view)
gimp_container_view_set_preview_size (view, preview_size);
gimp_container_view_set_preview_size (view, preview_size,
view->preview_border_width);
}
}
}

View File

@ -307,8 +307,7 @@ dialogs_image_list_view_new (GimpDialogFactory *factory,
view = gimp_image_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->images,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -329,8 +328,7 @@ dialogs_brush_list_view_new (GimpDialogFactory *factory,
dialogs_edit_brush_func,
context,
TRUE,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -350,8 +348,7 @@ dialogs_pattern_list_view_new (GimpDialogFactory *factory,
context->gimp->pattern_factory,
NULL,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Patterns>");
return dialogs_dockable_new (view,
@ -371,8 +368,7 @@ dialogs_gradient_list_view_new (GimpDialogFactory *factory,
context->gimp->gradient_factory,
dialogs_edit_gradient_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Gradients>");
return dialogs_dockable_new (view,
@ -392,8 +388,7 @@ dialogs_palette_list_view_new (GimpDialogFactory *factory,
context->gimp->palette_factory,
dialogs_edit_palette_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Palettes>");
return dialogs_dockable_new (view,
@ -411,9 +406,8 @@ dialogs_font_list_view_new (GimpDialogFactory *factory,
view = gimp_container_tree_view_new (context->gimp->fonts,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Font List"), _("Fonts"), NULL,
@ -430,9 +424,8 @@ dialogs_tool_list_view_new (GimpDialogFactory *factory,
view = gimp_container_tree_view_new (context->gimp->tool_info_list,
context,
preview_size,
FALSE,
5, 3);
preview_size, 0,
FALSE);
return dialogs_dockable_new (view,
_("Tool List"), _("Tools"), NULL,
@ -450,8 +443,7 @@ dialogs_buffer_list_view_new (GimpDialogFactory *factory,
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->named_buffers,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -474,8 +466,7 @@ dialogs_image_grid_view_new (GimpDialogFactory *factory,
view = gimp_image_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->images,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -496,8 +487,7 @@ dialogs_brush_grid_view_new (GimpDialogFactory *factory,
dialogs_edit_brush_func,
context,
TRUE,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -517,8 +507,7 @@ dialogs_pattern_grid_view_new (GimpDialogFactory *factory,
context->gimp->pattern_factory,
NULL,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Patterns>");
return dialogs_dockable_new (view,
@ -538,8 +527,7 @@ dialogs_gradient_grid_view_new (GimpDialogFactory *factory,
context->gimp->gradient_factory,
dialogs_edit_gradient_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Gradients>");
return dialogs_dockable_new (view,
@ -559,8 +547,7 @@ dialogs_palette_grid_view_new (GimpDialogFactory *factory,
context->gimp->palette_factory,
dialogs_edit_palette_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Palettes>");
return dialogs_dockable_new (view,
@ -578,9 +565,8 @@ dialogs_font_grid_view_new (GimpDialogFactory *factory,
view = gimp_container_grid_view_new (context->gimp->fonts,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Font Grid"), _("Fonts"), NULL,
@ -597,9 +583,8 @@ dialogs_tool_grid_view_new (GimpDialogFactory *factory,
view = gimp_container_grid_view_new (context->gimp->tool_info_list,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Tool Grid"), _("Tools"), NULL,
@ -617,8 +602,7 @@ dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->named_buffers,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -646,7 +630,7 @@ dialogs_layer_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 2,
gimage,
GIMP_TYPE_LAYER,
"active_layer_changed",
@ -680,7 +664,7 @@ dialogs_channel_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 1,
gimage,
GIMP_TYPE_CHANNEL,
"active_channel_changed",
@ -715,7 +699,7 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 1,
gimage,
GIMP_TYPE_VECTORS,
"active_vectors_changed",
@ -868,8 +852,7 @@ dialogs_document_list_new (GimpDialogFactory *factory,
view = gimp_document_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->documents,
context,
preview_size,
5, 3,
preview_size, 1,
file_file_open_dialog,
factory->menu_factory);
@ -890,8 +873,7 @@ dialogs_document_grid_new (GimpDialogFactory *factory,
view = gimp_document_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->documents,
context,
preview_size,
5, 3,
preview_size, 1,
file_file_open_dialog,
factory->menu_factory);
@ -912,8 +894,7 @@ dialogs_template_list_new (GimpDialogFactory *factory,
view = gimp_template_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->templates,
context,
preview_size,
5, 3,
preview_size, 0,
factory->menu_factory);
return dialogs_dockable_new (view,

View File

@ -36,6 +36,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpbrushfactoryview.h"
#include "widgets/gimpwidgets-constructors.h"
@ -159,10 +160,13 @@ brush_select_new (Gimp *gimp,
dialogs_edit_brush_func,
bsp->context,
FALSE,
GIMP_PREVIEW_SIZE_MEDIUM,
5, 5,
GIMP_PREVIEW_SIZE_MEDIUM, 1,
global_menu_factory);
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (GIMP_CONTAINER_EDITOR (bsp->view)->view),
5 * (GIMP_PREVIEW_SIZE_MEDIUM + 2),
5 * (GIMP_PREVIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (bsp->view), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (bsp->shell)->vbox), bsp->view);
gtk_widget_show (bsp->view);

View File

@ -253,7 +253,8 @@ dialogs_preview_size_cmd_callback (GtkWidget *widget,
view = gimp_container_view_get_by_dockable (dockable);
if (view)
gimp_container_view_set_preview_size (view, preview_size);
gimp_container_view_set_preview_size (view, preview_size,
view->preview_border_width);
}
}
}

View File

@ -307,8 +307,7 @@ dialogs_image_list_view_new (GimpDialogFactory *factory,
view = gimp_image_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->images,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -329,8 +328,7 @@ dialogs_brush_list_view_new (GimpDialogFactory *factory,
dialogs_edit_brush_func,
context,
TRUE,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -350,8 +348,7 @@ dialogs_pattern_list_view_new (GimpDialogFactory *factory,
context->gimp->pattern_factory,
NULL,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Patterns>");
return dialogs_dockable_new (view,
@ -371,8 +368,7 @@ dialogs_gradient_list_view_new (GimpDialogFactory *factory,
context->gimp->gradient_factory,
dialogs_edit_gradient_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Gradients>");
return dialogs_dockable_new (view,
@ -392,8 +388,7 @@ dialogs_palette_list_view_new (GimpDialogFactory *factory,
context->gimp->palette_factory,
dialogs_edit_palette_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Palettes>");
return dialogs_dockable_new (view,
@ -411,9 +406,8 @@ dialogs_font_list_view_new (GimpDialogFactory *factory,
view = gimp_container_tree_view_new (context->gimp->fonts,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Font List"), _("Fonts"), NULL,
@ -430,9 +424,8 @@ dialogs_tool_list_view_new (GimpDialogFactory *factory,
view = gimp_container_tree_view_new (context->gimp->tool_info_list,
context,
preview_size,
FALSE,
5, 3);
preview_size, 0,
FALSE);
return dialogs_dockable_new (view,
_("Tool List"), _("Tools"), NULL,
@ -450,8 +443,7 @@ dialogs_buffer_list_view_new (GimpDialogFactory *factory,
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->named_buffers,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -474,8 +466,7 @@ dialogs_image_grid_view_new (GimpDialogFactory *factory,
view = gimp_image_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->images,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -496,8 +487,7 @@ dialogs_brush_grid_view_new (GimpDialogFactory *factory,
dialogs_edit_brush_func,
context,
TRUE,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -517,8 +507,7 @@ dialogs_pattern_grid_view_new (GimpDialogFactory *factory,
context->gimp->pattern_factory,
NULL,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Patterns>");
return dialogs_dockable_new (view,
@ -538,8 +527,7 @@ dialogs_gradient_grid_view_new (GimpDialogFactory *factory,
context->gimp->gradient_factory,
dialogs_edit_gradient_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Gradients>");
return dialogs_dockable_new (view,
@ -559,8 +547,7 @@ dialogs_palette_grid_view_new (GimpDialogFactory *factory,
context->gimp->palette_factory,
dialogs_edit_palette_func,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory, "<Palettes>");
return dialogs_dockable_new (view,
@ -578,9 +565,8 @@ dialogs_font_grid_view_new (GimpDialogFactory *factory,
view = gimp_container_grid_view_new (context->gimp->fonts,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Font Grid"), _("Fonts"), NULL,
@ -597,9 +583,8 @@ dialogs_tool_grid_view_new (GimpDialogFactory *factory,
view = gimp_container_grid_view_new (context->gimp->tool_info_list,
context,
preview_size,
FALSE,
5, 3);
preview_size, 1,
FALSE);
return dialogs_dockable_new (view,
_("Tool Grid"), _("Tools"), NULL,
@ -617,8 +602,7 @@ dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
view = gimp_buffer_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->named_buffers,
context,
preview_size,
5, 3,
preview_size, 1,
factory->menu_factory);
return dialogs_dockable_new (view,
@ -646,7 +630,7 @@ dialogs_layer_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 2,
gimage,
GIMP_TYPE_LAYER,
"active_layer_changed",
@ -680,7 +664,7 @@ dialogs_channel_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 1,
gimage,
GIMP_TYPE_CHANNEL,
"active_channel_changed",
@ -715,7 +699,7 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory,
preview_size = context->gimp->config->layer_preview_size;
view =
gimp_item_tree_view_new (preview_size,
gimp_item_tree_view_new (preview_size, 1,
gimage,
GIMP_TYPE_VECTORS,
"active_vectors_changed",
@ -868,8 +852,7 @@ dialogs_document_list_new (GimpDialogFactory *factory,
view = gimp_document_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->documents,
context,
preview_size,
5, 3,
preview_size, 1,
file_file_open_dialog,
factory->menu_factory);
@ -890,8 +873,7 @@ dialogs_document_grid_new (GimpDialogFactory *factory,
view = gimp_document_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->documents,
context,
preview_size,
5, 3,
preview_size, 1,
file_file_open_dialog,
factory->menu_factory);
@ -912,8 +894,7 @@ dialogs_template_list_new (GimpDialogFactory *factory,
view = gimp_template_view_new (GIMP_VIEW_TYPE_LIST,
context->gimp->templates,
context,
preview_size,
5, 3,
preview_size, 0,
factory->menu_factory);
return dialogs_dockable_new (view,

View File

@ -113,9 +113,12 @@ font_select_new (Gimp *gimp,
/* The Font List */
font_select->view = gimp_container_tree_view_new (gimp->fonts,
font_select->context,
GIMP_PREVIEW_SIZE_MEDIUM,
FALSE,
5, 8);
GIMP_PREVIEW_SIZE_MEDIUM, 1,
FALSE);
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (font_select->view),
5 * (GIMP_PREVIEW_SIZE_MEDIUM + 2),
5 * (GIMP_PREVIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (font_select->view), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (font_select->shell)->vbox),

View File

@ -35,6 +35,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "dialogs-constructors.h"
@ -129,10 +130,13 @@ gradient_select_new (Gimp *gimp,
gimp->gradient_factory,
dialogs_edit_gradient_func,
gsp->context,
GIMP_PREVIEW_SIZE_MEDIUM,
6, 6,
GIMP_PREVIEW_SIZE_MEDIUM, 1,
global_menu_factory, "<Gradients>");
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (GIMP_CONTAINER_EDITOR (gsp->view)->view),
6 * (GIMP_PREVIEW_SIZE_MEDIUM + 2),
6 * (GIMP_PREVIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (gsp->view), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gsp->shell)->vbox), gsp->view);
gtk_widget_show (gsp->view);

View File

@ -35,6 +35,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "dialogs-constructors.h"
@ -131,10 +132,13 @@ palette_select_new (Gimp *gimp,
gimp->palette_factory,
dialogs_edit_palette_func,
psp->context,
GIMP_PREVIEW_SIZE_MEDIUM,
5, 8,
GIMP_PREVIEW_SIZE_MEDIUM, 1,
global_menu_factory, "<Palettes>");
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (GIMP_CONTAINER_EDITOR (psp->view)->view),
5 * (GIMP_PREVIEW_SIZE_MEDIUM + 2),
8 * (GIMP_PREVIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (psp->view), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (psp->shell)->vbox), psp->view);
gtk_widget_show (psp->view);

View File

@ -36,6 +36,7 @@
#include "pdb/procedural_db.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "menus.h"
@ -127,10 +128,13 @@ pattern_select_new (Gimp *gimp,
gimp->pattern_factory,
NULL,
psp->context,
GIMP_PREVIEW_SIZE_MEDIUM,
6, 6,
GIMP_PREVIEW_SIZE_MEDIUM, 1,
global_menu_factory, "<Patterns>");
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (GIMP_CONTAINER_EDITOR (psp->view)->view),
6 * (GIMP_PREVIEW_SIZE_MEDIUM + 2),
6 * (GIMP_PREVIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (psp->view), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (psp->shell)->vbox), psp->view);
gtk_widget_show (psp->view);

View File

@ -36,6 +36,7 @@
#include "gimpcontainerview.h"
#include "gimpbrushfactoryview.h"
#include "gimppreviewrenderer.h"
#include "gimp-intl.h"
@ -150,8 +151,7 @@ gimp_brush_factory_view_new (GimpViewType view_type,
GimpContext *context,
gboolean change_brush_spacing,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory)
{
GimpBrushFactoryView *factory_view;
@ -160,8 +160,9 @@ gimp_brush_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (min_items_x > 0 && min_items_x <= 64, NULL);
g_return_val_if_fail (min_items_y > 0 && min_items_y <= 64, NULL);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
NULL);
factory_view = g_object_new (GIMP_TYPE_BRUSH_FACTORY_VIEW, NULL);
@ -172,9 +173,7 @@ gimp_brush_factory_view_new (GimpViewType view_type,
factory,
edit_func,
context,
preview_size,
min_items_x,
min_items_y,
preview_size, preview_border_width,
menu_factory, "<Brushes>"))
{
g_object_unref (factory_view);

View File

@ -60,8 +60,7 @@ GtkWidget * gimp_brush_factory_view_new (GimpViewType view_type,
GimpContext *context,
gboolean change_brush_spacing,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory);

View File

@ -116,8 +116,7 @@ gimp_buffer_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory)
{
GimpBufferView *buffer_view;
@ -127,12 +126,9 @@ gimp_buffer_view_new (GimpViewType view_type,
if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (buffer_view),
view_type,
container,
context,
preview_size,
container,context,
preview_size, preview_border_width,
TRUE, /* reorderable */
min_items_x,
min_items_y,
menu_factory, "<Buffers>"))
{
g_object_unref (buffer_view);

View File

@ -58,8 +58,7 @@ GtkWidget * gimp_buffer_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory);

View File

@ -36,6 +36,7 @@
#include "gimpcontainertreeview.h"
#include "gimpitemfactory.h"
#include "gimpmenufactory.h"
#include "gimppreviewrenderer.h"
static void gimp_container_editor_class_init (GimpContainerEditorClass *klass);
@ -110,9 +111,8 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint preview_border_width,
gboolean reorderable,
gint min_items_x,
gint min_items_y,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier)
{
@ -121,8 +121,9 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, FALSE);
g_return_val_if_fail (min_items_x <= 64, FALSE);
g_return_val_if_fail (min_items_y <= 64, FALSE);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
FALSE);
g_return_val_if_fail (menu_factory == NULL ||
GIMP_IS_MENU_FACTORY (menu_factory), FALSE);
@ -133,9 +134,8 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
GIMP_CONTAINER_VIEW (gimp_container_grid_view_new (container,
context,
preview_size,
reorderable,
min_items_x,
min_items_y));
preview_border_width,
reorderable));
break;
case GIMP_VIEW_TYPE_LIST:
@ -143,9 +143,8 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
GIMP_CONTAINER_VIEW (gimp_container_tree_view_new (container,
context,
preview_size,
reorderable,
min_items_x,
min_items_y));
preview_border_width,
reorderable));
break;
default:

View File

@ -66,9 +66,8 @@ gboolean gimp_container_editor_construct (GimpContainerEditor *editor,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint preview_border_width,
gboolean reorderable,
gint min_items_x,
gint min_items_y,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier);

View File

@ -225,9 +225,8 @@ GtkWidget *
gimp_container_grid_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y)
gint preview_border_width,
gboolean reorderable)
{
GimpContainerGridView *grid_view;
@ -236,15 +235,16 @@ gimp_container_grid_view_new (GimpContainer *container,
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (min_items_x <= 64, NULL);
g_return_val_if_fail (min_items_y <= 64, NULL);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
NULL);
grid_view = g_object_new (GIMP_TYPE_CONTAINER_GRID_VIEW, NULL);
gimp_container_view_construct (GIMP_CONTAINER_VIEW (grid_view),
container, context,
preview_size, reorderable,
min_items_x, min_items_y);
preview_size, preview_border_width,
reorderable);
return GTK_WIDGET (grid_view);
}

View File

@ -63,9 +63,8 @@ GType gimp_container_grid_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_container_grid_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y);
gint preview_border_width,
gboolean reorderable);
#endif /* __GIMP_CONTAINER_GRID_VIEW_H__ */

View File

@ -454,9 +454,13 @@ gimp_container_popup_create_view (GimpContainerPopup *popup,
view_type,
popup->container,
popup->context,
GIMP_PREVIEW_SIZE_SMALL,
GIMP_PREVIEW_SIZE_SMALL, 1,
FALSE, /* reorderable */
6, 8, NULL, NULL);
NULL, NULL);
gimp_container_view_set_size_request (GIMP_CONTAINER_VIEW (GIMP_CONTAINER_EDITOR (popup->editor)->view),
6 * (GIMP_PREVIEW_SIZE_SMALL + 2),
8 * (GIMP_PREVIEW_SIZE_SMALL + 2));
if (GIMP_IS_CONTAINER_GRID_VIEW (popup->editor->view))
gtk_widget_hide (GIMP_CONTAINER_GRID_VIEW (popup->editor->view)->name_label);
@ -503,7 +507,7 @@ gimp_container_popup_smaller_clicked (GtkWidget *button,
popup->editor->view->preview_size * 0.8);
gimp_container_view_set_preview_size (popup->editor->view,
preview_size);
preview_size, 1);
}
static void
@ -516,7 +520,7 @@ gimp_container_popup_larger_clicked (GtkWidget *button,
popup->editor->view->preview_size * 1.2);
gimp_container_view_set_preview_size (popup->editor->view,
preview_size);
preview_size, 1);
}
static void

View File

@ -251,9 +251,8 @@ GtkWidget *
gimp_container_tree_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y)
gint preview_border_width,
gboolean reorderable)
{
GimpContainerTreeView *tree_view;
@ -262,15 +261,16 @@ gimp_container_tree_view_new (GimpContainer *container,
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (min_items_x > 0 && min_items_x <= 64, NULL);
g_return_val_if_fail (min_items_y > 0 && min_items_y <= 64, NULL);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
NULL);
tree_view = g_object_new (GIMP_TYPE_CONTAINER_TREE_VIEW, NULL);
gimp_container_view_construct (GIMP_CONTAINER_VIEW (tree_view),
container, context,
preview_size, reorderable,
min_items_x, min_items_y);
preview_size, preview_border_width,
reorderable);
return GTK_WIDGET (tree_view);
}

View File

@ -85,9 +85,8 @@ GType gimp_container_tree_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_container_tree_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y);
gint preview_border_width,
gboolean reorderable);
#endif /* __GIMP_CONTAINER_TREE_VIEW_H__ */

View File

@ -35,6 +35,7 @@
#include "gimpcontainerview.h"
#include "gimpcontainerview-utils.h"
#include "gimpdnd.h"
#include "gimppreviewrenderer.h"
enum
@ -344,25 +345,21 @@ gimp_container_view_construct (GimpContainerView *view,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y)
gint preview_border_width,
gboolean reorderable)
{
g_return_if_fail (GIMP_IS_CONTAINER_VIEW (view));
g_return_if_fail (container == NULL || GIMP_IS_CONTAINER (container));
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (min_items_x <= 64);
g_return_if_fail (min_items_y <= 64);
g_return_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
view->reorderable = reorderable ? TRUE : FALSE;
gimp_container_view_set_preview_size (view, preview_size);
gimp_container_view_set_size_request (view,
(preview_size + 2) * min_items_x,
(preview_size + 2) * min_items_y);
gimp_container_view_set_preview_size (view, preview_size,
preview_border_width);
if (container)
gimp_container_view_set_container (view, container);
@ -435,15 +432,20 @@ gimp_container_view_set_context (GimpContainerView *view,
void
gimp_container_view_set_preview_size (GimpContainerView *view,
gint preview_size)
gint preview_size,
gint preview_border_width)
{
g_return_if_fail (GIMP_IS_CONTAINER_VIEW (view));
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
if (view->preview_size != preview_size)
if (view->preview_size != preview_size ||
view->preview_border_width != preview_border_width)
{
view->preview_size = preview_size;
view->preview_size = preview_size;
view->preview_border_width = preview_border_width;
GIMP_CONTAINER_VIEW_GET_CLASS (view)->set_preview_size (view);
}

View File

@ -99,16 +99,16 @@ void gimp_container_view_construct (GimpContainerView *view,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y);
gint preview_border_width,
gboolean reorderable);
void gimp_container_view_set_container (GimpContainerView *view,
GimpContainer *container);
void gimp_container_view_set_context (GimpContainerView *view,
GimpContext *context);
void gimp_container_view_set_preview_size (GimpContainerView *view,
gint preview_size);
gint preview_size,
gint preview_border_width);
void gimp_container_view_set_name_func (GimpContainerView *view,
GimpItemGetNameFunc get_name_func);

View File

@ -132,8 +132,7 @@ gimp_data_factory_view_new (GimpViewType view_type,
GimpDataEditFunc edit_func,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier)
{
@ -147,8 +146,7 @@ gimp_data_factory_view_new (GimpViewType view_type,
edit_func,
context,
preview_size,
min_items_x,
min_items_y,
preview_border_width,
menu_factory,
menu_identifier))
{
@ -166,8 +164,7 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
GimpDataEditFunc edit_func,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier)
{
@ -177,22 +174,19 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, FALSE);
g_return_val_if_fail (min_items_x > 0 && min_items_x <= 64, FALSE);
g_return_val_if_fail (min_items_y > 0 && min_items_y <= 64, FALSE);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
FALSE);
factory_view->factory = factory;
factory_view->data_edit_func = edit_func;
if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (factory_view),
view_type,
factory->container,
context,
preview_size,
factory->container, context,
preview_size, preview_border_width,
FALSE, /* reorderable */
min_items_x,
min_items_y,
menu_factory,
menu_identifier))
menu_factory, menu_identifier))
{
return FALSE;
}

View File

@ -67,8 +67,7 @@ GtkWidget * gimp_data_factory_view_new (GimpViewType view_type,
GimpDataEditFunc edit_func,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier);
@ -81,8 +80,7 @@ gboolean gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
GimpDataEditFunc edit_func,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier);

View File

@ -135,8 +135,7 @@ gimp_document_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpFileOpenDialogFunc file_open_dialog_func,
GimpMenuFactory *menu_factory)
{
@ -150,12 +149,9 @@ gimp_document_view_new (GimpViewType view_type,
if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (document_view),
view_type,
container,
context,
preview_size,
container, context,
preview_size, preview_border_width,
TRUE, /* reorderable */
min_items_x,
min_items_y,
menu_factory, "<Documents>"))
{
g_object_unref (document_view);

View File

@ -63,8 +63,7 @@ GtkWidget * gimp_document_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpFileOpenDialogFunc file_open_dialog_func,
GimpMenuFactory *menu_factory);

View File

@ -112,8 +112,7 @@ gimp_image_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory)
{
GimpImageView *image_view;
@ -123,12 +122,9 @@ gimp_image_view_new (GimpViewType view_type,
if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (image_view),
view_type,
container,
context,
preview_size,
container, context,
preview_size, preview_border_width,
TRUE, /* reorderable */
min_items_x,
min_items_y,
menu_factory, "<Images>"))
{
g_object_unref (image_view);

View File

@ -57,8 +57,7 @@ GtkWidget * gimp_image_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory);

View File

@ -340,6 +340,7 @@ gimp_item_tree_view_destroy (GtkObject *object)
GtkWidget *
gimp_item_tree_view_new (gint preview_size,
gint preview_border_width,
GimpImage *gimage,
GType item_type,
const gchar *signal_name,
@ -355,6 +356,9 @@ gimp_item_tree_view_new (gint preview_size,
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (preview_border_width >= 0 &&
preview_border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH,
NULL);
g_return_val_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (signal_name != NULL, NULL);
g_return_val_if_fail (new_item_func != NULL, NULL);
@ -387,8 +391,7 @@ gimp_item_tree_view_new (gint preview_size,
gimp_container_view_construct (GIMP_CONTAINER_VIEW (item_view),
NULL, NULL,
preview_size, TRUE,
-1, -1);
preview_size, preview_border_width, TRUE);
view->dnd_widget = NULL;
@ -919,12 +922,13 @@ static void
gimp_item_tree_view_size_changed (GimpImage *gimage,
GimpItemTreeView *view)
{
gint preview_size;
GimpContainerView *container_view;
preview_size = GIMP_CONTAINER_VIEW (view)->preview_size;
container_view = GIMP_CONTAINER_VIEW (view);
gimp_container_view_set_preview_size (GIMP_CONTAINER_VIEW (view),
preview_size);
container_view->preview_size,
container_view->preview_border_width);
}
static void

View File

@ -114,6 +114,7 @@ struct _GimpItemTreeViewClass
GType gimp_item_tree_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_item_tree_view_new (gint preview_size,
gint preview_border_width,
GimpImage *gimage,
GType item_type,
const gchar *signal_name,

View File

@ -231,8 +231,6 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view)
view->model_column_mask_visible = tree_view->n_model_columns;
tree_view->model_columns[tree_view->n_model_columns++] = G_TYPE_BOOLEAN;
GIMP_CONTAINER_VIEW (view)->preview_border_width = 2;
view->options_box = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (view->options_box), 2);
gtk_box_pack_start (GTK_BOX (view), view->options_box, FALSE, FALSE, 0);

View File

@ -147,7 +147,9 @@ gimp_menu_item_real_set_viewable (GimpMenuItem *menu_item,
gtk_widget_set_size_request (menu_item->preview,
menu_item->preview_size +
2 * menu_item->preview_border_width,
-1);
menu_item->preview_size +
2 * menu_item->preview_border_width);
gtk_box_pack_start (GTK_BOX (menu_item->hbox), menu_item->preview,
FALSE, FALSE, 0);
gtk_widget_show (menu_item->preview);

View File

@ -121,8 +121,7 @@ gimp_template_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory)
{
GimpTemplateView *template_view;
@ -132,12 +131,9 @@ gimp_template_view_new (GimpViewType view_type,
if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (template_view),
view_type,
container,
context,
preview_size,
container, context,
preview_size, preview_border_width,
TRUE, /* reorderable */
min_items_x,
min_items_y,
menu_factory, "<Templates>"))
{
g_object_unref (template_view);

View File

@ -58,8 +58,7 @@ GtkWidget * gimp_template_view_new (GimpViewType view_type,
GimpContainer *container,
GimpContext *context,
gint preview_size,
gint min_items_x,
gint min_items_y,
gint preview_border_width,
GimpMenuFactory *menu_factory);

View File

@ -106,10 +106,9 @@ gimp_undo_editor_init (GimpUndoEditor *undo_editor)
{
undo_editor->container = NULL;
undo_editor->view = gimp_container_tree_view_new (NULL,
NULL,
GIMP_UNDO_PREVIEW_SIZE,
FALSE, 3, 3);
undo_editor->view = gimp_container_tree_view_new (NULL, NULL,
GIMP_UNDO_PREVIEW_SIZE, 1,
FALSE);
gtk_container_add (GTK_CONTAINER (undo_editor), undo_editor->view);
gtk_widget_show (undo_editor->view);