[Xfce4-commits] <design:master> Add new mockup code for a custom shortcuts view instead of a tree view.

Jannis Pohlmann noreply at xfce.org
Mon May 30 23:38:01 CEST 2011


Updating branch refs/heads/master
         to 3d3b59a7f404455b8e7a57939413bb6b0808e49a (commit)
       from 304dbfe8fde77b43725793cc65714bc3fa3d39c3 (commit)

commit 3d3b59a7f404455b8e7a57939413bb6b0808e49a
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Mon May 30 23:36:31 2011 +0200

    Add new mockup code for a custom shortcuts view instead of a tree view.

 .../shortcuts-pane/demo-code/custom-view/Makefile  |    7 ++
 .../demo-code/custom-view/mockup.vala              |   59 ++++++++++++++++++++
 .../demo-code/custom-view/shortcuts-view.vala      |   45 +++++++++++++++
 3 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/thunar/shortcuts-pane/demo-code/custom-view/Makefile b/thunar/shortcuts-pane/demo-code/custom-view/Makefile
new file mode 100644
index 0000000..95cf8b2
--- /dev/null
+++ b/thunar/shortcuts-pane/demo-code/custom-view/Makefile
@@ -0,0 +1,7 @@
+VALA_FLAGS  = 
+VALA_FLAGS += --pkg gtk+-2.0
+
+VALA_FILES  = mockup.vala shortcuts-view.vala
+
+default:
+	valac $(VALA_FLAGS) $(VALA_FILES) && ./mockup
diff --git a/thunar/shortcuts-pane/demo-code/custom-view/mockup.vala b/thunar/shortcuts-pane/demo-code/custom-view/mockup.vala
new file mode 100644
index 0000000..5a44325
--- /dev/null
+++ b/thunar/shortcuts-pane/demo-code/custom-view/mockup.vala
@@ -0,0 +1,59 @@
+/* vi:set et ai sw=2 sts=2 ts=2: */
+/*-
+ * Copyright (c) 2011 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+using Gtk;
+
+
+
+int main (string[] args) {
+  Gtk.init (ref args);
+
+  var window = new Window ();
+  window.title = "Shortcuts Pane Mockup (Custom View)";
+  window.set_default_size (300, 600);
+  window.position = WindowPosition.CENTER;
+  window.destroy.connect (Gtk.main_quit);
+
+  var frame = new Frame (null);
+  frame.set_shadow_type (ShadowType.NONE);
+  frame.set_border_width (24);
+  window.add (frame);
+  frame.show ();
+
+  var scrollwin = new ScrolledWindow (null, null);
+  scrollwin.set_shadow_type (ShadowType.ETCHED_IN);
+  scrollwin.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
+  frame.add (scrollwin);
+  scrollwin.show ();
+
+  var viewport = new Viewport (null, null);
+  scrollwin.add (viewport);
+  viewport.show ();
+
+  var view = new ShortcutsView ();
+  viewport.add (view);
+  view.show ();
+
+  window.show ();
+
+  Gtk.main ();
+
+  return 0;
+}
diff --git a/thunar/shortcuts-pane/demo-code/custom-view/shortcuts-view.vala b/thunar/shortcuts-pane/demo-code/custom-view/shortcuts-view.vala
new file mode 100644
index 0000000..30e9254
--- /dev/null
+++ b/thunar/shortcuts-pane/demo-code/custom-view/shortcuts-view.vala
@@ -0,0 +1,45 @@
+/* vi:set et ai sw=2 sts=2 ts=2: */
+/*-
+ * Copyright (c) 2011 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+using Gtk;
+
+
+
+public class ShortcutsView : EventBox {
+  private VBox box { get; set; }
+
+  public ShortcutsView () {
+    box = new VBox (false, 2);
+    box.set_border_width (2);
+    add (box);
+    box.show ();
+
+    var devices_expander = new Expander ("DEVICES");
+    box.pack_start(devices_expander, false, true, 0);
+
+    var places_expander = new Expander ("PLACES");
+    box.pack_start(places_expander, false, true, 0);
+
+    var network_expander = new Expander ("NETWORK");
+    box.pack_start(network_expander, false, true, 0);
+
+    show_all ();
+  }
+}



More information about the Xfce4-commits mailing list