mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
GTK: hook SetMinSize. fuck around with gtk_widget_set_size_request() so the window can be resized smaller than the initial size.
This commit is contained in:
@ -85,6 +85,11 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
|
|||||||
{ \
|
{ \
|
||||||
gtk_widget_grab_focus(type(c)->widget); \
|
gtk_widget_grab_focus(type(c)->widget); \
|
||||||
}
|
}
|
||||||
|
#define uiUnixControlDefaultSetMinSize(type) \
|
||||||
|
static void type ## SetMinSize(uiControl *c, int w, int h) \
|
||||||
|
{ \
|
||||||
|
gtk_widget_set_size_request(type(c)->widget, w, h); \
|
||||||
|
}
|
||||||
// TODO this whole addedBefore stuff is a MASSIVE HACK.
|
// TODO this whole addedBefore stuff is a MASSIVE HACK.
|
||||||
#define uiUnixControlDefaultSetContainer(type) \
|
#define uiUnixControlDefaultSetContainer(type) \
|
||||||
static void type ## SetContainer(uiUnixControl *c, GtkContainer *container, gboolean remove) \
|
static void type ## SetContainer(uiUnixControl *c, GtkContainer *container, gboolean remove) \
|
||||||
@ -112,6 +117,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
|
|||||||
uiUnixControlDefaultEnable(type) \
|
uiUnixControlDefaultEnable(type) \
|
||||||
uiUnixControlDefaultDisable(type) \
|
uiUnixControlDefaultDisable(type) \
|
||||||
uiUnixControlDefaultSetFocus(type) \
|
uiUnixControlDefaultSetFocus(type) \
|
||||||
|
uiUnixControlDefaultSetMinSize(type) \
|
||||||
uiUnixControlDefaultSetContainer(type)
|
uiUnixControlDefaultSetContainer(type)
|
||||||
|
|
||||||
#define uiUnixControlAllDefaults(type) \
|
#define uiUnixControlAllDefaults(type) \
|
||||||
@ -133,6 +139,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
|
|||||||
uiControl(var)->Enable = type ## Enable; \
|
uiControl(var)->Enable = type ## Enable; \
|
||||||
uiControl(var)->Disable = type ## Disable; \
|
uiControl(var)->Disable = type ## Disable; \
|
||||||
uiControl(var)->SetFocus = type ## SetFocus; \
|
uiControl(var)->SetFocus = type ## SetFocus; \
|
||||||
|
uiControl(var)->SetMinSize = type ## SetMinSize; \
|
||||||
uiUnixControl(var)->SetContainer = type ## SetContainer;
|
uiUnixControl(var)->SetContainer = type ## SetContainer;
|
||||||
// TODO document
|
// TODO document
|
||||||
_UI_EXTERN uiUnixControl *uiUnixAllocControl(size_t n, uint32_t typesig, const char *typenamestr);
|
_UI_EXTERN uiUnixControl *uiUnixAllocControl(size_t n, uint32_t typesig, const char *typenamestr);
|
||||||
|
@ -134,6 +134,7 @@ uiUnixControlDefaultEnabled(uiWindow)
|
|||||||
uiUnixControlDefaultEnable(uiWindow)
|
uiUnixControlDefaultEnable(uiWindow)
|
||||||
uiUnixControlDefaultDisable(uiWindow)
|
uiUnixControlDefaultDisable(uiWindow)
|
||||||
uiUnixControlDefaultSetFocus(uiWindow)
|
uiUnixControlDefaultSetFocus(uiWindow)
|
||||||
|
uiUnixControlDefaultSetMinSize(uiWindow)
|
||||||
// TODO?
|
// TODO?
|
||||||
uiUnixControlDefaultSetContainer(uiWindow)
|
uiUnixControlDefaultSetContainer(uiWindow)
|
||||||
|
|
||||||
@ -310,6 +311,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar,
|
|||||||
|
|
||||||
// set client size proper
|
// set client size proper
|
||||||
gtk_widget_set_size_request(w->childHolderWidget, width, height);
|
gtk_widget_set_size_request(w->childHolderWidget, width, height);
|
||||||
|
gtk_widget_set_size_request(w->childHolderWidget, 1, 1);
|
||||||
|
|
||||||
// show everything in the vbox, but not the GtkWindow itself
|
// show everything in the vbox, but not the GtkWindow itself
|
||||||
gtk_widget_show_all(w->vboxWidget);
|
gtk_widget_show_all(w->vboxWidget);
|
||||||
|
Reference in New Issue
Block a user