[med-svn] [Git][med-team/amide][master] Make main window resizable

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Feb 24 19:42:17 GMT 2024



Andreas Tille pushed to branch master at Debian Med / amide


Commits:
c73bdc22 by Andreas Tille at 2024-02-24T20:30:56+01:00
Make main window resizable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/resizable-window.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+amide (1.0.6-5) unstable; urgency=medium
+
+  * Team upload.
+  * Make main window resizable
+    Closes: #901677
+
+ -- Yavor Doganov <yavor at gnu.org>  Sat, 24 Feb 2024 20:28:56 +0100
+
 amide (1.0.6-4) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/resizable-window.patch
=====================================
@@ -0,0 +1,193 @@
+Description: Make the main (study) window resizable.
+ Toolbar menu items "Thickness", "Field of view" and "Zoom" do nothing
+ but they are necessary -- if the window is resized so that the right
+ border is at one of these widgets, no drop-down arrow will be shown
+ so the user will not have access to the Gate/Time buttons.  Other
+ items from "Threshold" leftwards are proper GtkToolItems (rather than
+ widgets packed in a GtkToolItem) so their menus are fully functional
+ and will appear as normal/toggle/radio menu items.
+Bug-Debian: https://bugs.debian.org/901677
+Bug: https://github.com/ferdymercury/amide/issues/26
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2024-02-24
+---
+
+--- amide.orig/amide-current/src/ui_study.c
++++ amide/amide-current/src/ui_study.c
+@@ -540,7 +540,7 @@
+   toolbar = gtk_toolbar_new();
+   gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), toolbar, FALSE, FALSE, 0);
+   gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
+-  gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), FALSE);
++  gtk_widget_set_hexpand(toolbar, FALSE);
+ 
+   tool_item = gtk_radio_tool_button_new(NULL);
+   gtk_tool_button_set_label(GTK_TOOL_BUTTON(tool_item), _("Near."));
+@@ -568,9 +568,8 @@
+   for (i_rendering = 0; i_rendering < AMITK_RENDERING_NUM; i_rendering++) 
+     gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ui_study->rendering_menu), amitk_rendering_get_name(i_rendering));
+   g_signal_connect(G_OBJECT(ui_study->rendering_menu), "changed", G_CALLBACK(ui_study_cb_rendering), ui_study);
+-  ui_common_toolbar_insert_widget(toolbar, ui_study->rendering_menu,
+-                                  _(amitk_rendering_explanation),
+-                                  gtk_toolbar_get_n_items(GTK_TOOLBAR(toolbar)));
++  ui_common_toolbar_append_widget(toolbar, ui_study->rendering_menu,
++                                  _(amitk_rendering_explanation));
+ 
+   ui_common_toolbar_append_separator(toolbar);
+ 
+@@ -672,7 +671,7 @@
+ 
+   icon = gtk_image_new_from_icon_name("amide_icon_thresholding",
+                                       GTK_ICON_SIZE_LARGE_TOOLBAR);
+-  tool_item = gtk_tool_button_new(icon, _("_Threshold"));
++  tool_item = gtk_tool_button_new(icon, _("Threshold"));
+   gtk_tool_item_set_tooltip_text(tool_item,
+                                  _("Set the thresholds and colormaps for the active data set"));
+   gtk_actionable_set_action_name(GTK_ACTIONABLE(tool_item), "win.thresholding");
+@@ -697,7 +696,10 @@
+   g_signal_connect(G_OBJECT(ui_study->zoom_spin), "output", G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+   g_signal_connect(G_OBJECT(ui_study->zoom_spin), "button_press_event",
+ 		   G_CALLBACK(amitk_spin_button_discard_double_or_triple_click), NULL);
+-  ui_common_toolbar_append_widget(toolbar,ui_study->zoom_spin,_("specify how much to magnify the images"));
++  ui_common_toolbar_append_widget_full(toolbar, ui_study->zoom_spin,
++                                       _("Zoom"),
++                                       _("specify how much to magnify the images"),
++                                       NULL, NULL);
+ 
+   /* a separator for clarity */
+   ui_common_toolbar_append_separator(toolbar);
+@@ -716,7 +718,10 @@
+   g_signal_connect(G_OBJECT(ui_study->fov_spin), "value_changed", G_CALLBACK(ui_study_cb_fov), ui_study);
+   g_signal_connect(G_OBJECT(ui_study->fov_spin), "button_press_event",
+ 		   G_CALLBACK(amitk_spin_button_discard_double_or_triple_click), NULL);
+-  ui_common_toolbar_append_widget(toolbar,ui_study->fov_spin,_("specify how much of the image field of view to display"));
++  ui_common_toolbar_append_widget_full(toolbar, ui_study->fov_spin,
++                                       _("Field of view"),
++                                       _("specify how much of the image field of view to display"),
++                                       NULL, NULL);
+ 
+   /* a separator for clarity */
+   ui_common_toolbar_append_separator(toolbar);
+@@ -736,7 +741,10 @@
+   g_signal_connect(G_OBJECT(ui_study->thickness_spin), "output", G_CALLBACK(amitk_spin_button_scientific_output), NULL);
+   g_signal_connect(G_OBJECT(ui_study->thickness_spin), "button_press_event",
+ 		   G_CALLBACK(amitk_spin_button_discard_double_or_triple_click), NULL);
+-  ui_common_toolbar_append_widget(toolbar,ui_study->thickness_spin,_("specify how thick to make the slices (mm)"));
++  ui_common_toolbar_append_widget_full(toolbar, ui_study->thickness_spin,
++                                       _("Thickness"),
++                                       _("specify how thick to make the slices (mm)"),
++                                       NULL, NULL);
+ 
+   /* a separator for clarity */
+   ui_common_toolbar_append_separator(toolbar);
+@@ -749,9 +757,10 @@
+ 
+   ui_study->gate_button = gtk_button_new_with_label("?");
+   g_signal_connect(G_OBJECT(ui_study->gate_button), "clicked", G_CALLBACK(ui_study_cb_gate), ui_study);
+-  ui_common_toolbar_append_widget(toolbar, ui_study->gate_button,
+-				  _("the gate range over which to view the data"));
+-
++  ui_common_toolbar_append_widget_full(toolbar, ui_study->gate_button,
++                                       _("Gate"),
++                                       _("the gate range over which to view the data"),
++                                       G_CALLBACK(ui_study_cb_gate), ui_study);
+ 
+   /* a separator for clarity */
+   ui_common_toolbar_append_separator(toolbar);
+@@ -762,8 +771,10 @@
+ 
+   ui_study->time_button = gtk_button_new_with_label("?"); 
+   g_signal_connect(G_OBJECT(ui_study->time_button), "clicked", G_CALLBACK(ui_study_cb_time), ui_study);
+-  ui_common_toolbar_append_widget(toolbar, ui_study->time_button,
+-				  _("the time range over which to view the data (s)"));
++  ui_common_toolbar_append_widget_full(toolbar, ui_study->time_button,
++                                       _("Time"),
++                                       _("the time range over which to view the data (s)"),
++                                       G_CALLBACK(ui_study_cb_time), ui_study);
+ 
+   return;
+ }
+@@ -1540,13 +1551,22 @@
+ void ui_study_setup_widgets(ui_study_t * ui_study) {
+ 
+   GtkWidget * scrolled;
++  GtkWidget * scrld;
+   GtkWidget * left_vbox;
+   GtkWidget * hbox;
+ 
+ 
+   /* the hbox that'll contain everything in the ui besides the menu and toolbar */
+   hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
+-  gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), hbox, TRUE, TRUE, 0);
++  scrld = gtk_scrolled_window_new(NULL, NULL);
++  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrld),
++                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
++  gtk_scrolled_window_set_propagate_natural_width(GTK_SCROLLED_WINDOW(scrld),
++                                                  TRUE);
++  gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrld),
++                                                   TRUE);
++  gtk_container_add(GTK_CONTAINER(scrld), hbox);
++  gtk_box_pack_start (GTK_BOX (ui_study->window_vbox), scrld, TRUE, TRUE, 0);
+ 
+   /* make and add the left packing table */
+   left_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+@@ -1638,9 +1658,6 @@
+   gtk_window_set_default_icon(pixbuf); /* sets it as the default for all additional windows */
+   g_object_unref(pixbuf);
+ 
+-  /* disable user resizability, allows the window to autoshrink */  
+-  gtk_window_set_resizable(ui_study->window, FALSE); 
+-
+   /* setup the callbacks for the window */
+   g_signal_connect(G_OBJECT(ui_study->window), "delete_event",  
+ 		   G_CALLBACK(ui_study_cb_delete_event), ui_study);
+--- amide.orig/amide-current/src/ui_common.c
++++ amide/amide-current/src/ui_common.c
+@@ -821,6 +821,25 @@
+   return;
+ }
+ 
++void ui_common_toolbar_append_widget_full(GtkWidget * toolbar, GtkWidget * widget, const gchar * label, const gchar * tooltip, GCallback cb, gpointer data) {
++
++  GtkToolItem * toolbar_item;
++  GtkWidget * menu_item;
++
++  toolbar_item = gtk_tool_item_new();
++  gtk_container_add(GTK_CONTAINER(toolbar_item), widget);
++  if (tooltip != NULL)
++    gtk_widget_set_tooltip_text(widget, tooltip);
++  if (label != NULL) {
++    menu_item = gtk_menu_item_new_with_label(label);
++    gtk_tool_item_set_proxy_menu_item(toolbar_item, label, menu_item);
++    if (cb != NULL)
++      g_signal_connect(menu_item, "activate", cb, data);
++  }
++  gtk_tool_item_set_homogeneous(toolbar_item, FALSE);
++  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolbar_item, -1);
++}
++
+ void ui_common_toolbar_append_separator(GtkWidget * toolbar) {
+   GtkToolItem * toolbar_item;
+   toolbar_item =  gtk_separator_tool_item_new();
+--- amide.orig/amide-current/src/ui_common.h
++++ amide/amide-current/src/ui_common.h
+@@ -86,6 +86,7 @@
+ GList * ui_common_init_dialog_selected_objects(GtkWidget * dialog);
+ void ui_common_toolbar_insert_widget(GtkWidget * toolbar, GtkWidget * widget, const gchar * tooltip, gint position);
+ void ui_common_toolbar_append_widget(GtkWidget * toolbar, GtkWidget * widget, const gchar * tooltip);
++void ui_common_toolbar_append_widget_full(GtkWidget * toolbar, GtkWidget * widget, const gchar * label, const gchar * tooltip, GCallback cb, gpointer data);
+ void ui_common_toolbar_append_separator(GtkWidget * toolbar);
+ 
+ void amide_call_help(const gchar * link_id);
+--- amide.orig/amide-current/configure.ac
++++ amide/amide-current/configure.ac
+@@ -369,7 +369,7 @@
+ 	glib-2.0	>= 2.68.0
+ 	gio-2.0         >= 2.68.0
+ 	gobject-2.0	>= 2.68.0
+-	gtk+-3.0	>= 3.21.5
++	gtk+-3.0	>= 3.21.6
+ 	libxml-2.0	>= 2.4.12
+ 	goocanvas-2.0   >= 2.0.2
+ ])


=====================================
debian/patches/series
=====================================
@@ -10,3 +10,4 @@ gsettings.patch
 gtk3+goocanvas.patch
 no-gnome-vfs.patch
 compiler-warnings.patch
+resizable-window.patch



View it on GitLab: https://salsa.debian.org/med-team/amide/-/commit/c73bdc2243313df1a50cb2f8a8bec237cef414a6

-- 
View it on GitLab: https://salsa.debian.org/med-team/amide/-/commit/c73bdc2243313df1a50cb2f8a8bec237cef414a6
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240224/b3b4d9bd/attachment-0001.htm>


More information about the debian-med-commit mailing list