[gnome-music/playlists] implement inline toolbar



commit fadd64d9d4d20b74ce64c8f5fcf1c756b794e9e5
Author: Eslam Mostafa <me eslammostafa com>
Date:   Mon Jun 17 14:38:01 2013 +0200

    implement inline toolbar

 data/PlaylistControls.ui |   71 +++++++++++++--------------------------------
 src/view.js              |    4 +-
 2 files changed, 23 insertions(+), 52 deletions(-)
---
diff --git a/data/PlaylistControls.ui b/data/PlaylistControls.ui
index 267ffeb..6d4f84f 100644
--- a/data/PlaylistControls.ui
+++ b/data/PlaylistControls.ui
@@ -1,66 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
-  <object class="GtkBox" id="playlistControls">
+  <object class="GtkToolbar" id="container">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">9</property>
+    <property name="show_arrow">False</property>
     <style>
-      <class name="playlist-controls"/>
+      <class name="inline-toolbar"/>
     </style>
     <child>
-      <object class="GtkBox" id="buttonsBox">
+      <object class="GtkToolButton" id="addPlaylist">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <style>
-          <class name="linked"/>
-        </style>
-        <child>
-          <object class="GtkButton" id="addPlaylist">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <child>
-              <object class="GtkImage" id="image1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="icon_name">list-add</property>
-                <property name="use_fallback">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButton" id="removePlaylist">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="focus_on_click">False</property>
-            <child>
-              <object class="GtkImage" id="image2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="icon_name">list-remove</property>
-                <property name="use_fallback">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
+        <property name="label" translatable="yes">toolbutton1</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">list-add</property>
       </object>
       <packing>
         <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="removePlaylist">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">toolbutton1</property>
+        <property name="use_underline">True</property>
+        <property name="icon_name">list-remove</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
       </packing>
     </child>
   </object>
diff --git a/src/view.js b/src/view.js
index 39c28f3..abfa2b9 100644
--- a/src/view.js
+++ b/src/view.js
@@ -511,11 +511,11 @@ const Playlists = new Lang.Class({
         this.view.get_style_context().add_class("artist-panel");
         this.view.get_generic_view().get_selection().set_mode(Gtk.SelectionMode.SINGLE);
         builder.add_from_resource('/org/gnome/music/PlaylistControls.ui');
-        let controls = builder.get_object('playlistControls');
+        let controls = builder.get_object('container');
         this._grid.attach(new Gtk.Separator(), 0, 1, 1, 1);
         this._grid.attach(controls, 0, 2, 1, 1);
         this._grid.attach(new Gtk.Separator({orientation: Gtk.Orientation.VERTICAL}), 1, 0, 1, 3);
-        this._grid.attach(this._playlistSongsWidget, 2, 0, 2, 2);
+        this._grid.attach(this._playlistSongsWidget, 2, 0, 2, 3);
         this._addListRenderers();
         if(Gtk.Settings.get_default().gtk_application_prefer_dark_theme) {
             this.view.get_generic_view().get_style_context().add_class("artist-panel-dark");


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