add ui_set_enabled and ui_set_visible (QT)

Fri, 03 Oct 2025 11:25:10 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 03 Oct 2025 11:25:10 +0200
changeset 792
c0e92f157af5
parent 791
c83b9acfa316
child 793
f33f05cd0548

add ui_set_enabled and ui_set_visible (QT)

ui/qt/widget.cpp file | annotate | diff | comparison | revisions
ui/ui/toolkit.h file | annotate | diff | comparison | revisions
ui/ui/widget.h file | annotate | diff | comparison | revisions
--- a/ui/qt/widget.cpp	Fri Oct 03 11:20:34 2025 +0200
+++ b/ui/qt/widget.cpp	Fri Oct 03 11:25:10 2025 +0200
@@ -52,6 +52,14 @@
     return separator;
 }
 
+void ui_set_enabled(UIWIDGET widget, int enabled) {
+    widget->setEnabled(enabled);
+}
+
+void ui_set_visible(UIWIDGET widget, int visible) {
+    widget->setVisible(visible);
+}
+
 void ui_widget_set_size(UIWIDGET w, int width, int height) {
     w->resize(width >= 0 ? width : w->width(), height >= 0 ? height : w->height());
 }
--- a/ui/ui/toolkit.h	Fri Oct 03 11:20:34 2025 +0200
+++ b/ui/ui/toolkit.h	Fri Oct 03 11:25:10 2025 +0200
@@ -666,11 +666,6 @@
 
 UIEXPORT void ui_add_image(char *imgname, char *filename); // TODO: remove?
 
-// general widget functions
-UIEXPORT void ui_set_enabled(UIWIDGET widget, int enabled);
-UIEXPORT void ui_set_show_all(UIWIDGET widget, int value);
-UIEXPORT void ui_set_visible(UIWIDGET widget, int visible);
-
 
 
 UIEXPORT void ui_listselection_free(UiListSelection selection);
--- a/ui/ui/widget.h	Fri Oct 03 11:20:34 2025 +0200
+++ b/ui/ui/widget.h	Fri Oct 03 11:25:10 2025 +0200
@@ -69,6 +69,9 @@
 
 #define ui_separator(obj, ...) ui_separator_create(obj, &(UiWidgetArgs){ __VA_ARGS__ } )
 
+UIEXPORT void ui_set_enabled(UIWIDGET widget, int enabled);
+UIEXPORT void ui_set_visible(UIWIDGET widget, int visible);
+
 UIEXPORT void ui_widget_set_size(UIWIDGET w, int width, int height);
 UIEXPORT void ui_widget_redraw(UIWIDGET w);
 

mercurial