Merge branch 'wip/martymichal/container-popup-predictable-sizing' into 'master'

app: Use correct maximum size for button viewables

Closes Teams/GIMP/Design/gimp-ux#509 and #14337

See merge request GNOME/gimp!2353
This commit is contained in:
Ondřej Míchal 2025-07-02 20:25:57 +03:00
commit 019f35ca15
5 changed files with 10 additions and 9 deletions

View file

@ -27,7 +27,7 @@
#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE 2048
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
#define GIMP_VIEWABLE_MAX_BUTTON_SIZE 64
#define GIMP_VIEWABLE_MAX_BUTTON_SIZE GIMP_VIEW_SIZE_GIGANTIC
#define GIMP_VIEWABLE_MAX_MENU_SIZE 48

View file

@ -32,6 +32,7 @@
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpviewable.h"
#include "core/gimp-utils.h"
#include "gimpcontainerbox.h"
#include "gimpcontainereditor.h"
@ -213,7 +214,7 @@ gimp_container_popup_set_view_type (GimpContainerPopup *popup,
}
}
gint
GimpViewSize
gimp_container_popup_get_view_size (GimpContainerPopup *popup)
{
g_return_val_if_fail (GIMP_IS_CONTAINER_POPUP (popup), GIMP_VIEW_SIZE_SMALL);
@ -223,7 +224,7 @@ gimp_container_popup_get_view_size (GimpContainerPopup *popup)
void
gimp_container_popup_set_view_size (GimpContainerPopup *popup,
gint view_size)
GimpViewSize view_size)
{
GtkWidget *scrolled_win;
GtkWidget *viewport;
@ -366,7 +367,7 @@ gimp_container_popup_smaller_clicked (GtkWidget *button,
view_size = gimp_container_view_get_view_size (popup->editor->view, NULL);
gimp_container_popup_set_view_size (popup, view_size * 0.8);
gimp_container_popup_set_view_size (popup, gimp_view_size_get_smaller (view_size));
}
static void
@ -377,7 +378,7 @@ gimp_container_popup_larger_clicked (GtkWidget *button,
view_size = gimp_container_view_get_view_size (popup->editor->view, NULL);
gimp_container_popup_set_view_size (popup, view_size * 1.2);
gimp_container_popup_set_view_size (popup, gimp_view_size_get_larger (view_size));
}
static void

View file

@ -80,9 +80,9 @@ GimpViewType gimp_container_popup_get_view_type (GimpContainerPopup *popup);
void gimp_container_popup_set_view_type (GimpContainerPopup *popup,
GimpViewType view_type);
gint gimp_container_popup_get_view_size (GimpContainerPopup *popup);
GimpViewSize gimp_container_popup_get_view_size (GimpContainerPopup *popup);
void gimp_container_popup_set_view_size (GimpContainerPopup *popup,
gint view_size);
GimpViewSize view_size);
#endif /* __GIMP_CONTAINER_POPUP_H__ */

View file

@ -351,7 +351,7 @@ gimp_viewable_button_get_view_size (GimpViewableButton *button)
void
gimp_viewable_button_set_view_size (GimpViewableButton *button,
gint view_size)
GimpViewSize view_size)
{
g_return_if_fail (GIMP_IS_VIEWABLE_BUTTON (button));

View file

@ -78,7 +78,7 @@ void gimp_viewable_button_set_view_type (GimpViewableButton *button,
gint gimp_viewable_button_get_view_size (GimpViewableButton *button);
void gimp_viewable_button_set_view_size (GimpViewableButton *button,
gint view_size);
GimpViewSize view_size);
#endif /* __GIMP_VIEWABLE_BUTTON_H__ */