← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~tombeckmann/granite/dynamic-notebook into lp:granite

 

Tom Beckmann has proposed merging lp:~tombeckmann/granite/dynamic-notebook into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)

For more details, see:
https://code.launchpad.net/~tombeckmann/granite/dynamic-notebook/+merge/92817

- Added the Granite.Widgets.DynamicNotebook
- clutter-gtk-1.0 is now another dependency
- modified the granite-demo to use the DynamicNotebook class
-- 
https://code.launchpad.net/~tombeckmann/granite/dynamic-notebook/+merge/92817
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'demo/CMakeLists.txt'
--- demo/CMakeLists.txt	2011-11-07 20:33:01 +0000
+++ demo/CMakeLists.txt	2012-02-13 18:15:26 +0000
@@ -20,6 +20,7 @@
     ${CMAKE_CURRENT_BINARY_DIR}/../lib/granite.vapi
 PACKAGES
     gtk+-3.0
+    clutter-gtk-1.0
 OPTIONS
     --thread
 )

=== modified file 'demo/main.vala'
--- demo/main.vala	2012-02-11 20:05:28 +0000
+++ demo/main.vala	2012-02-13 18:15:26 +0000
@@ -63,14 +63,14 @@
         var win = new Gtk.Window();
         win.delete_event.connect( () => { Gtk.main_quit(); return false; });
 
-        var notebook = new Gtk.Notebook();
+        var notebook = new Granite.Widgets.DynamicNotebook();
         win.add(notebook);
 
         /* welcome */
 
         // These strings will be automatically corrected by the widget
         var welcome = new Welcome("Granite's Welcome Screen", "This is Granite's Welcome widget.");
-        notebook.append_page(welcome, new Gtk.Label("Welcome"));
+        notebook.append_page(welcome, "Welcome");
 
         Gdk.Pixbuf? pixbuf = null;
 
@@ -131,7 +131,7 @@
         mode_button.append(new Gtk.Label("Small"));
         mode_button.append(new Gtk.Label("a"));
         vbox.pack_start(mode_button);
-        notebook.append_page(vbox, new Gtk.Label("ModeButton"));
+        notebook.append_page(vbox, "ModeButton");
 
         /* static notebook */
         var staticbox = new Gtk.VBox (false, 5);
@@ -147,9 +147,9 @@
 
         staticbox.add (staticnotebook);
 
-        notebook.append_page (staticbox, new Gtk.Label ("Static Notebook"));
+        notebook.append_page (staticbox, "Static Notebook");
         var button_about = new Gtk.Button.with_label("show_about");
-        notebook.append_page (button_about, new Gtk.Label ("About Dialog"));
+        notebook.append_page (button_about, "About Dialog");
         button_about.clicked.connect(() => { show_about(win); } );
 
         var popover_buttons = new Gtk.VBox(false, 0);
@@ -178,17 +178,17 @@
         });
         popover_buttons.pack_start(new Gtk.Label("Let's try the PopOvers!"), false, false);
         popover_buttons.pack_start(hbox3, false, false);
-        notebook.append_page (popover_buttons, new Gtk.Label ("PopOvers"));
+        notebook.append_page (popover_buttons, "PopOvers");
 
         var calendar_button = new Gtk.HBox(false, 0);
         var date_button = new Granite.Widgets.DatePicker.with_format("%d-%m-%y");
         date_button.valign = date_button.halign = Gtk.Align.CENTER;
         calendar_button.add(date_button);
-        notebook.append_page (calendar_button, new Gtk.Label ("Calendar"));
+        notebook.append_page (calendar_button, "Calendar");
 
         /* Contractor */
         var contractor_tab = new Gtk.VBox (false, 0);
-        notebook.append_page (contractor_tab, new Gtk.Label ("Contractor"));
+        notebook.append_page (contractor_tab, "Contractor");
         var text_view = new Gtk.TextView ();
         GLib.HashTable<string, string>[] hash_ = Contractor.get_contract("/.zip", "application/zip");
         foreach(var hash in hash_)
@@ -198,6 +198,17 @@
         contractor_tab.add(text_view);
         contractor_tab.add(new ContractorView("file:///home/user/file.txt", "text/plain"));
 
+        /* DynamicNotebook */
+        var tab_working = new Gtk.Button.with_label ("Toggle first tab's working state");
+        tab_working.halign = tab_working.valign = Gtk.Align.CENTER;
+        tab_working.clicked.connect ( () => {
+            notebook.get_tab (0).working = !notebook.get_tab (0).working;
+        });
+        notebook.append_page (tab_working, "Dynamic Notebook");
+
+        /* focus first tab */
+        notebook.active = notebook.get_tab (0);
+
         /* window properties */
         win.show_all();
         win.resize(800, 600);

=== modified file 'lib/Application.vala'
--- lib/Application.vala	2012-01-15 22:15:55 +0000
+++ lib/Application.vala	2012-02-13 18:15:26 +0000
@@ -100,6 +100,8 @@
 
             set_options ();
 
+            GtkClutter.init (ref args);
+
             return base.run (args);
         }
 

=== modified file 'lib/CMakeLists.txt'
--- lib/CMakeLists.txt	2012-02-06 21:19:07 +0000
+++ lib/CMakeLists.txt	2012-02-13 18:15:26 +0000
@@ -23,8 +23,8 @@
 find_package(PkgConfig)
 find_package(GObjectIntrospection 0.9.12)
 include(GObjectIntrospectionMacros)
-set(PKG_DEPS gtk+-3.0 gio-unix-2.0)
-pkg_check_modules(DEPS REQUIRED gtk+-3.0 gio-unix-2.0 gthread-2.0 gee-1.0)
+set(PKG_DEPS gtk+-3.0 gio-unix-2.0 clutter-gtk-1.0)
+pkg_check_modules(DEPS REQUIRED gtk+-3.0 gio-unix-2.0 gthread-2.0 gee-1.0 clutter-gtk-1.0)
 # Link all
 
 set(CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER})
@@ -68,6 +68,7 @@
     Widgets/ToolButtonWithMenu.vala
     Widgets/PopOver.vala
     Widgets/ContractorView.vala
+    Widgets/DynamicNotebook.vala
     Main.vala
     config.vapi
 CUSTOM_VAPIS
@@ -122,11 +123,11 @@
 
 add_custom_target(docs)
 add_custom_command (TARGET docs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/docs -R -f)
-add_custom_command (TARGET docs COMMAND valadoc -o docs --doclet-arg=${CMAKE_CURRENT_BINARY_DIR}/granite.h ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=granite --package-version=0.1.1 --doclet=gtkdoc)
+add_custom_command (TARGET docs COMMAND valadoc -o docs --doclet-arg=${CMAKE_CURRENT_BINARY_DIR}/granite.h ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --pkg=clutter-gtk-1.0 --package-name=granite --package-version=0.1.1 --doclet=gtkdoc)
 add_custom_target (valadocs)
 add_custom_command (TARGET valadocs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/docs_vala -R -f)
 add_custom_command (TARGET valadocs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/images -R -f)
 add_custom_command (TARGET valadocs COMMAND cp ${CMAKE_SOURCE_DIR}/doc/images/ ${CMAKE_CURRENT_BINARY_DIR}/images -R)
-add_custom_command (TARGET valadocs COMMAND VALADOC_HEADER=${CMAKE_CURRENT_SOURCE_DIR}/docs/header.html valadoc -o docs_vala ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=glib-2.0 --pkg=gio-2.0 --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=Granite --package-version=0.1.1 --driver 0.13.x --force --doclet=elementary)
+add_custom_command (TARGET valadocs COMMAND VALADOC_HEADER=${CMAKE_CURRENT_SOURCE_DIR}/docs/header.html valadoc -o docs_vala ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=glib-2.0 --pkg=gio-2.0 --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --pkg=clutter-gtk-1.0 --package-name=Granite --package-version=0.1.1 --driver 0.13.x --force --doclet=elementary)
 add_custom_command (TARGET valadocs COMMAND cp ${CMAKE_SOURCE_DIR}/doc/css/ ${CMAKE_CURRENT_BINARY_DIR}/docs_vala/css -R)
 

=== modified file 'lib/granite.deps'
--- lib/granite.deps	2011-06-13 12:29:06 +0000
+++ lib/granite.deps	2012-02-13 18:15:26 +0000
@@ -1,2 +1,3 @@
 gtk+-3.0
 gio-unix-2.0
+clutter-gtk-1.0
\ No newline at end of file

=== modified file 'lib/granite.pc.cmake'
--- lib/granite.pc.cmake	2011-10-26 17:36:49 +0000
+++ lib/granite.pc.cmake	2012-02-13 18:15:26 +0000
@@ -8,5 +8,5 @@
 Version: @GRANITE_VERSION@
 Libs: -L@DOLLAR@{libdir} -lgranite
 Cflags: -I@DOLLAR@{includedir}/${PKGNAME}
-Requires: gtk+-3.0
+Requires: gtk+-3.0 clutter-gtk-1.0
 


Follow ups