[gnome-builder/wip/gtk4-port: 927/1774] plugins/debuggerui: move debugger controls into panel




commit 8655df11965df8e422a0a0be3cb952349f771f71
Author: Christian Hergert <chergert redhat com>
Date:   Sun May 8 14:44:00 2022 -0700

    plugins/debuggerui: move debugger controls into panel
    
    This appears to be closest to debugger things, even though I've really
    wanted it near the actual run button for a while. This seems to flow
    a bit better and look less heavy than in the header bar.

 src/plugins/debuggerui/ide-debugger-controls.ui    | 29 ++++++++++++++++++----
 .../debuggerui/ide-debugger-workspace-addin.c      | 12 ++-------
 2 files changed, 26 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/debuggerui/ide-debugger-controls.ui b/src/plugins/debuggerui/ide-debugger-controls.ui
index c48152a21..2edd8d678 100644
--- a/src/plugins/debuggerui/ide-debugger-controls.ui
+++ b/src/plugins/debuggerui/ide-debugger-controls.ui
@@ -8,16 +8,17 @@
         <property name="transition-duration">500</property>
         <child>
           <object class="GtkBox">
-            <property name="margin-start">6</property>
+            <property name="margin-end">6</property>
+            <property name="spacing">3</property>
             <property name="orientation">horizontal</property>
-            <style>
-              <class name="linked"/>
-            </style>
             <child>
               <object class="GtkButton" id="pause_button">
                 <property name="action-name">debugger.stop</property>
                 <property name="tooltip-text" translatable="yes">Interrupt the program</property>
                 <property name="icon-name">media-playback-pause-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             <child>
@@ -25,6 +26,9 @@
                 <property name="action-name">debugger.continue</property>
                 <property name="tooltip-text" translatable="yes">Continue running the program</property>
                 <property name="icon-name">debug-continue-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             <!--
@@ -33,13 +37,19 @@
                 <property name="action-name">debugger.execute-from-cursor</property>
                 <property name="tooltip-text" translatable="yes">Execute from the current cursor 
position</property>
                 <property name="icon-name">debug-execute-from-cursor-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             <child>
               <object class="GtkButton" id="execute_to_cursor_button">
                 <property name="action-name">debugger.execute-to-cursor</property>
                 <property name="tooltip-text" translatable="yes">Execute until reaching the current cursor 
position</property>
-              <property name="icon-name">debug-execute-to-cursor-symbolic</property>
+                <property name="icon-name">debug-execute-to-cursor-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             -->
@@ -48,6 +58,9 @@
                 <property name="action-name">debugger.step-in</property>
                 <property name="tooltip-text" translatable="yes">Execute the current line, stepping into any 
function calls</property>
                 <property name="icon-name">debug-step-in-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             <child>
@@ -55,6 +68,9 @@
                 <property name="action-name">debugger.step-over</property>
                 <property name="tooltip-text" translatable="yes">Execute the current line, stepping over any 
function calls</property>
                 <property name="icon-name">debug-step-over-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
             <child>
@@ -62,6 +78,9 @@
                 <property name="action-name">debugger.finish</property>
                 <property name="tooltip-text" translatable="yes">Run until the end of the function</property>
                 <property name="icon-name">debug-step-out-symbolic</property>
+                <style>
+                  <class name="flat"/>
+                </style>
               </object>
             </child>
           </object>
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.c 
b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
index 4addba307..3c141245c 100644
--- a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
@@ -265,7 +265,6 @@ static void
 ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
 {
   g_autoptr(IdePanelPosition) position = NULL;
-  IdeHeaderBar *header_bar;
   GtkNotebook *notebook;
   PanelPaned *hpaned;
 
@@ -276,12 +275,6 @@ ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
                                  "visible", FALSE,
                                  NULL);
 
-  header_bar = ide_workspace_get_header_bar (self->workspace);
-  ide_header_bar_add (header_bar,
-                      IDE_HEADER_BAR_POSITION_RIGHT_OF_CENTER,
-                      100,
-                      GTK_WIDGET (self->controls));
-
   ide_pane_observe (g_object_new (IDE_TYPE_PANE,
                                   "title", _("Debugger"),
                                   "icon-name", "builder-debugger-symbolic",
@@ -293,6 +286,8 @@ ide_debugger_workspace_addin_add_ui (IdeDebuggerWorkspaceAddin *self)
                            NULL);
   panel_widget_set_child (PANEL_WIDGET (self->panel), GTK_WIDGET (notebook));
 
+  gtk_notebook_set_action_widget (notebook, GTK_WIDGET (self->controls), GTK_PACK_START);
+
   hpaned = g_object_new (PANEL_TYPE_PANED,
                          "orientation", GTK_ORIENTATION_HORIZONTAL,
                          NULL);
@@ -409,7 +404,6 @@ ide_debugger_workspace_addin_unload (IdeWorkspaceAddin *addin,
                                      IdeWorkspace      *workspace)
 {
   IdeDebuggerWorkspaceAddin *self = (IdeDebuggerWorkspaceAddin *)addin;
-  IdeHeaderBar *header_bar;
 
   IDE_ENTRY;
 
@@ -422,8 +416,6 @@ ide_debugger_workspace_addin_unload (IdeWorkspaceAddin *addin,
   gtk_widget_insert_action_group (GTK_WIDGET (self->workspace), "debugger", NULL);
   ide_run_manager_remove_handler (self->run_manager, "debugger");
 
-  header_bar = ide_workspace_get_header_bar (workspace);
-  ide_header_bar_remove (header_bar, GTK_WIDGET (self->controls));
   self->controls = NULL;
 
   g_clear_object (&self->debugger_signals);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]