[gnome-characters] Reorganize *.ui files for template migration



commit b79cb80d5a6330e5fb5e4d0c0485ff7634a5c269
Author: Daiki Ueno <dueno src gnome org>
Date:   Mon Nov 24 10:23:51 2014 +0900

    Reorganize *.ui files for template migration

 data/character.ui                            |   30 ++++----
 data/main.ui                                 |  104 --------------------------
 data/mainview.ui                             |   59 +++++++++++++++
 data/mainwindow.ui                           |   66 ++++++++++++++++
 data/org.gnome.Characters.data.gresource.xml |    4 +-
 data/sidebar.ui                              |   12 ---
 src/window.js                                |   12 +--
 7 files changed, 146 insertions(+), 141 deletions(-)
---
diff --git a/data/character.ui b/data/character.ui
index 8286fb8..6e54cdc 100644
--- a/data/character.ui
+++ b/data/character.ui
@@ -14,9 +14,9 @@
        <property name="row_spacing">50</property>
        <child>
          <object class="GtkLabel" id="character-label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="ellipsize">end</property>
+           <property name="visible">True</property>
+           <property name="can_focus">False</property>
+           <property name="ellipsize">end</property>
            <property name="halign">center</property>
            <property name="valign">center</property>
            <style>
@@ -24,34 +24,34 @@
            </style>
          </object>
          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
+           <property name="left_attach">0</property>
+           <property name="top_attach">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkButton" id="copy-button">
-            <property name="label" translatable="yes">Copy Character</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
+           <property name="label" translatable="yes">Copy Character</property>
+           <property name="visible">True</property>
+           <property name="can_focus">True</property>
+           <property name="receives_default">False</property>
          </object>
          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
+           <property name="left_attach">0</property>
+           <property name="top_attach">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkLabel" id="detail-label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
+           <property name="visible">True</property>
+           <property name="can_focus">False</property>
            <property name="halign">center</property>
            <style>
              <class name="detail-label"/>
            </style>
          </object>
          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">2</property>
+           <property name="left_attach">0</property>
+           <property name="top_attach">2</property>
          </packing>
        </child>
       </object>
diff --git a/data/mainview.ui b/data/mainview.ui
new file mode 100644
index 0000000..f19057d
--- /dev/null
+++ b/data/mainview.ui
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="3.12"/>
+  <object class="GtkGrid" id="search-banner-grid">
+    <property name="can_focus">False</property>
+    <property name="visible">True</property>
+    <property name="orientation">horizontal</property>
+    <property name="halign">center</property>
+    <property name="valign">center</property>
+    <style>
+      <class name="banner"/>
+    </style>
+    <child>
+      <object class="GtkImage" id="search-banner-image">
+       <property name="can_focus">False</property>
+       <property name="visible">True</property>
+       <property name="icon_name">edit-find-symbolic</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel" id="search-banner-label">
+       <property name="can_focus">False</property>
+       <property name="visible">True</property>
+       <property name="label" translatable="yes">Type to Search</property>
+       <style>
+         <class name="banner-label"/>
+       </style>
+      </object>
+    </child>
+  </object>
+  <object class="GtkGrid" id="loading-banner-grid">
+    <property name="can_focus">False</property>
+    <property name="visible">True</property>
+    <property name="orientation">horizontal</property>
+    <property name="halign">center</property>
+    <property name="valign">center</property>
+    <style>
+      <class name="banner"/>
+    </style>
+    <child>
+      <object class="GtkSpinner" id="loading-banner-spinner">
+       <property name="can_focus">False</property>
+       <property name="visible">True</property>
+       <property name="width-request">128</property>
+       <property name="height-request">128</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel" id="loading-banner-label">
+       <property name="can_focus">False</property>
+       <property name="visible">True</property>
+       <property name="label" translatable="yes">Loading...</property>
+       <style>
+         <class name="banner-label"/>
+       </style>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/data/mainwindow.ui b/data/mainwindow.ui
new file mode 100644
index 0000000..65f80cc
--- /dev/null
+++ b/data/mainwindow.ui
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="3.12"/>
+  <object class="GtkHeaderBar" id="main-headerbar">
+    <property name="can_focus">False</property>
+    <property name="visible">True</property>
+    <property name="show-close-button">True</property>
+    <property name="title" translatable="yes">Current page</property>
+    <child>
+      <object class="GtkToggleButton" id="search-active-button">
+       <property name="can_focus">True</property>
+       <property name="visible">True</property>
+       <style>
+         <class name="image-button"/>
+       </style>
+       <child>
+         <object class="GtkImage" id="search-button-image">
+           <property name="visible">True</property>
+           <property name="icon-name">edit-find-symbolic</property>
+         </object>
+       </child>
+      </object>
+      <packing>
+       <property name="pack-type">start</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkGrid" id="main-grid">
+    <property name="can_focus">False</property>
+    <property name="visible">True</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkSearchBar" id="search-bar">
+       <property name="visible">True</property>
+       <property name="hexpand">True</property>
+       <child>
+         <object class="GtkSearchEntry" id="search-entry">
+           <property name="can_focus">True</property>
+           <property name="width-request">500</property>
+           <property name="halign">center</property>
+         </object>
+       </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox" id="main-hbox">
+       <property name="can_focus">False</property>
+       <property name="visible">True</property>
+       <property name="orientation">horizontal</property>
+       <child>
+         <object class="GtkGrid" id="sidebar-grid">
+           <property name="can_focus">False</property>
+           <property name="visible">True</property>
+           <property name="orientation">vertical</property>
+           <child>
+             <placeholder/>
+           </child>
+         </object>
+       </child>
+       <child>
+         <placeholder/>
+       </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/data/org.gnome.Characters.data.gresource.xml b/data/org.gnome.Characters.data.gresource.xml
index 729e149..41136b5 100644
--- a/data/org.gnome.Characters.data.gresource.xml
+++ b/data/org.gnome.Characters.data.gresource.xml
@@ -2,8 +2,8 @@
 <gresources>
   <gresource prefix="/org/gnome/Characters">
     <file preprocess="xml-stripblanks">app-menu.ui</file>
-    <file preprocess="xml-stripblanks">main.ui</file>
-    <file preprocess="xml-stripblanks">sidebar.ui</file>
+    <file preprocess="xml-stripblanks">mainwindow.ui</file>
+    <file preprocess="xml-stripblanks">mainview.ui</file>
     <file preprocess="xml-stripblanks">character.ui</file>
     <file>application.css</file>
   </gresource>
diff --git a/src/window.js b/src/window.js
index af00130..94cc43e 100644
--- a/src/window.js
+++ b/src/window.js
@@ -75,10 +75,9 @@ const MainWindow = new Lang.Class({
                             parameter_type: new GLib.VariantType('s') }]);
 
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/Characters/main.ui');
-        builder.add_from_resource('/org/gnome/Characters/sidebar.ui');
+        builder.add_from_resource('/org/gnome/Characters/mainwindow.ui');
 
-        this._headerBar = builder.get_object('main-header');
+        this._headerBar = builder.get_object('main-headerbar');
         this.set_titlebar(this._headerBar);
 
         let searchBtn = builder.get_object('search-active-button');
@@ -97,18 +96,15 @@ const MainWindow = new Lang.Class({
                             Lang.bind(this, this._handleSearchChanged));
 
         let grid = builder.get_object('main-grid');
-        let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL });
 
         let sidebarGrid = builder.get_object('sidebar-grid');
         this._categoryList = new CategoryList.CategoryListWidget();
         sidebarGrid.add(this._categoryList);
-        hbox.pack_start(sidebarGrid, false, false, 2);
 
+        let hbox = builder.get_object('main-hbox');
         this._mainView = new MainView();
         hbox.pack_start(this._mainView, true, true, 0);
 
-        grid.add(hbox);
-
         this.add(grid);
         grid.show_all();
 
@@ -218,7 +214,7 @@ const MainView = new Lang.Class({
         this._characterListWidgets['search-result'] = characterList;
 
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/Characters/main.ui');
+        builder.add_from_resource('/org/gnome/Characters/mainview.ui');
         let searchBannerGrid = builder.get_object('search-banner-grid');
         this.add_named(searchBannerGrid, 'search-banner');
         let loadingBannerGrid = builder.get_object('loading-banner-grid');


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