[baobab/wip/gtk4: 12/16] more porting



commit eab15fd87b1e3fc954aa57a4072cd831d51c1a4c
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Sep 28 11:34:01 2017 +0200

    more porting

 src/baobab-chart.vala     |    7 +++----
 src/baobab-main-window.ui |   30 +-----------------------------
 src/baobab-window.vala    |    4 ++--
 3 files changed, 6 insertions(+), 35 deletions(-)
---
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index a202b15..1aa7665 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -223,6 +223,7 @@ namespace Baobab {
             insert_action_group ("chart", action_group);
 
             build_context_menu ();
+            set_draw_func (draw_func);
         }
 
         public override void size_allocate (Gtk.Allocation allocation, int baseline, out Gtk.Allocation 
clip) {
@@ -410,10 +411,10 @@ namespace Baobab {
             update_draw (path);
         }
 
-        public override bool draw (Cairo.Context cr) {
+        public void draw_func (Gtk.DrawingArea area, Cairo.Context cr, int width, int height) {
             if (name_column == percentage_column) {
                 // Columns not set
-                return false;
+                return;
             }
 
             if (model != null) {
@@ -428,8 +429,6 @@ namespace Baobab {
 
                 draw_chart (cr);
             }
-
-            return false;
         }
 
         Gdk.RGBA interpolate_colors (Gdk.RGBA colora, Gdk.RGBA colorb, double percentage) {
diff --git a/src/baobab-main-window.ui b/src/baobab-main-window.ui
index aa3d868..15d7f8d 100644
--- a/src/baobab-main-window.ui
+++ b/src/baobab-main-window.ui
@@ -2,11 +2,9 @@
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkMenu" id="treeview_popup_menu">
-    <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
       <object class="GtkMenuItem" id="treeview_popup_open">
-        <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">_Open Folder</property>
         <property name="use_underline">True</property>
@@ -14,7 +12,6 @@
     </child>
     <child>
       <object class="GtkMenuItem" id="treeview_popup_copy">
-        <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">_Copy Path to Clipboard</property>
         <property name="use_underline">True</property>
@@ -22,7 +19,6 @@
     </child>
     <child>
       <object class="GtkMenuItem" id="treeview_popup_trash">
-        <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Mo_ve to Trash</property>
         <property name="use_underline">True</property>
@@ -30,7 +26,6 @@
     </child>
   </object>
   <object class="GtkHeaderBar" id="header_bar">
-    <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="show_close_button">True</property>
     <style>
@@ -55,7 +50,6 @@
         </style>
         <child>
           <object class="GtkImage" id="back_button_image">
-            <property name="visible">True</property>
             <property name="icon_name">go-previous-symbolic</property>
             <property name="icon_size">1</property>
           </object>
@@ -75,7 +69,6 @@
         </style>
         <child>
           <object class="GtkImage" id="reload_button_image">
-            <property name="visible">True</property>
             <property name="icon_size">1</property>
             <property name="icon_name">view-refresh-symbolic</property>
           </object>
@@ -92,24 +85,20 @@
     <child>
       <object class="GtkBox" id="vbox">
       <property name="orientation">vertical</property>
-      <property name="visible">True</property>
       <child>
         <object class="GtkGrid" id="window_contents">
-          <property name="visible">True</property>
           <property name="orientation">vertical</property>
           <child>
             <object class="GtkInfoBar" id="infobar">
-              <property name="visible">False</property>
+              <property name="revealed">False</property>
               <child internal-child="content_area">
                 <object class="GtkBox" id="infobar_content_area">
-                  <property name="visible">True</property>
                   <property name="can_focus">False</property>
                   <property name="orientation">vertical</property>
                   <property name="spacing">16</property>
                   <property name="hexpand">True</property>
                   <child>
                     <object class="GtkLabel" id="infobar_primary_label">
-                      <property name="visible">True</property>
                       <property name="can_focus">True</property>
                       <property name="selectable">True</property>
                       <property name="use-markup">True</property>
@@ -119,7 +108,6 @@
                   </child>
                   <child>
                     <object class="GtkLabel" id="infobar_secondary_label">
-                      <property name="visible">True</property>
                       <property name="can_focus">True</property>
                       <property name="selectable">True</property>
                       <property name="use-markup">True</property>
@@ -131,14 +119,12 @@
               </child>
               <child internal-child="action_area">
                 <object class="GtkButtonBox" id="infobar_action_area">
-                  <property name="visible">True</property>
                   <property name="can_focus">False</property>
                   <property name="orientation">vertical</property>
                   <property name="spacing">6</property>
                   <property name="layout_style">end</property>
                   <child>
                     <object class="GtkButton" id="infobar_close_button">
-                      <property name="visible">True</property>
                       <property name="label" translatable="yes">Close</property>
                     </object>
                   </child>
@@ -148,17 +134,14 @@
           </child>
           <child>
             <object class="GtkStack" id="main_stack">
-              <property name="visible">True</property>
               <property name="can_focus">False</property>
               <property name="transition_type">slide-left-right</property>
               <child>
                 <object class="GtkGrid" id="home_page">
                   <property name="can_focus">False</property>
-                  <property name="visible">True</property>
                   <property name="orientation">vertical</property>
                   <child>
                     <object class="GtkScrolledWindow" id="location_scrolled_window">
-                      <property name="visible">True</property>
                       <property name="vexpand">True</property>
                       <property name="hexpand">True</property>
                       <property name="hscrollbar-policy">never</property>
@@ -174,18 +157,15 @@
               </child>
               <child>
                 <object class="GtkGrid" id="result_page">
-                  <property name="visible">True</property>
                   <property name="can_focus">False</property>
                   <property name="column_homogeneous">True</property>
                   <child>
                     <object class="GtkScrolledWindow" id="scrolled_window">
-                      <property name="visible">True</property>
                       <property name="can_focus">True</property>
                       <property name="shadow_type">in</property>
                       <property name="hexpand">True</property>
                       <child>
                         <object class="GtkTreeView" id="treeview">
-                          <property name="visible">True</property>
                           <property name="can_focus">True</property>
                           <child internal-child="selection">
                             <object class="GtkTreeSelection" id="treeview_selection1"/>
@@ -284,21 +264,17 @@
                   </child>
                   <child>
                     <object class="GtkGrid" id="chart_grid">
-                      <property name="visible">True</property>
                       <property name="can_focus">False</property>
                       <property name="hexpand">True</property>
                       <property name="vexpand">True</property>
                       <child>
                         <object class="GtkStack" id="spinner_stack">
-                          <property name="visible">True</property>
                           <child>
                             <object class="GtkStack" id="chart_stack">
-                              <property name="visible">True</property>
                               <property name="can_focus">True</property>
                               <property name="transition_type">crossfade</property>
                               <child>
                                 <object class="BaobabRingschart" id="rings_chart">
-                                  <property name="visible">True</property>
                                   <property name="hexpand">True</property>
                                   <property name="vexpand">True</property>
                                 </object>
@@ -310,7 +286,6 @@
                               </child>
                               <child>
                                 <object class="BaobabTreemap" id="treemap_chart">
-                                  <property name="visible">True</property>
                                   <property name="hexpand">True</property>
                                   <property name="vexpand">True</property>
                                 </object>
@@ -324,7 +299,6 @@
                           </child>
                           <child>
                             <object class="GtkSpinner" id="spinner">
-                              <property name="visible">True</property>
                               <property name="can_focus">False</property>
                               <property name="width_request">128</property>
                               <property name="height_request">128</property>
@@ -342,10 +316,8 @@
                       </child>
                       <child>
                         <object class="GtkActionBar" id="chart_action_bar">
-                        <property name="visible">True</property>
                           <child type="center">
                             <object class="GtkStackSwitcher" id="chart_stack_switcher">
-                              <property name="visible">True</property>
                               <property name="stack">chart_stack</property>
                             </object>
                           </child>
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 621722a..75838d1 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -452,11 +452,11 @@ namespace Baobab {
             infobar.message_type = type;
             infobar_primary_label.label = "<b>%s</b>".printf (primary_msg);
             infobar_secondary_label.label = "<small>%s</small>".printf (secondary_msg);
-            infobar.show ();
+            infobar.set_revealed (true);
         }
 
         void clear_message () {
-            infobar.hide ();
+            infobar.set_revealed (false);
         }
 
         void set_busy (bool busy) {


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