diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/branch/branch.conf granite-0.0.1/.bzr/branch/branch.conf --- granite-0.0.1~bzr35~natty3~0/.bzr/branch/branch.conf 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/.bzr/branch/branch.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -parent_location = bzr+ssh://bazaar.launchpad.net/%2Bbranch/granite/ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/branch/format granite-0.0.1/.bzr/branch/format --- granite-0.0.1~bzr35~natty3~0/.bzr/branch/format 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/.bzr/branch/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Bazaar Branch Format 7 (needs bzr 1.6) diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/branch/last-revision granite-0.0.1/.bzr/branch/last-revision --- granite-0.0.1~bzr35~natty3~0/.bzr/branch/last-revision 2011-06-24 07:51:06.000000000 +0000 +++ granite-0.0.1/.bzr/branch/last-revision 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -35 maxwell@elementaryos.org-20110623141642-m2fiu546164mqd15 diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/branch-format granite-0.0.1/.bzr/branch-format --- granite-0.0.1~bzr35~natty3~0/.bzr/branch-format 2011-06-18 08:28:47.000000000 +0000 +++ granite-0.0.1/.bzr/branch-format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Bazaar-NG meta directory, format 1 diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/checkout/conflicts granite-0.0.1/.bzr/checkout/conflicts --- granite-0.0.1~bzr35~natty3~0/.bzr/checkout/conflicts 2011-06-24 07:51:06.000000000 +0000 +++ granite-0.0.1/.bzr/checkout/conflicts 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -BZR conflict list format 1 Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/checkout/dirstate and /tmp/DceZstIxjg/granite-0.0.1/.bzr/checkout/dirstate differ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/checkout/format granite-0.0.1/.bzr/checkout/format --- granite-0.0.1~bzr35~natty3~0/.bzr/checkout/format 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/.bzr/checkout/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Bazaar Working Tree Format 6 (bzr 1.14) diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/checkout/merge-hashes granite-0.0.1/.bzr/checkout/merge-hashes --- granite-0.0.1~bzr35~natty3~0/.bzr/checkout/merge-hashes 2011-06-24 07:51:06.000000000 +0000 +++ granite-0.0.1/.bzr/checkout/merge-hashes 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -BZR merge-modified list format 1 -file_id: application.vala-20110524020158-75w5sbydndlxyo3b-1 -hash: cd2d3dda250380915dd1629114c8c9d1ee98de7a diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/README granite-0.0.1/.bzr/README --- granite-0.0.1~bzr35~natty3~0/.bzr/README 2011-06-18 08:28:47.000000000 +0000 +++ granite-0.0.1/.bzr/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -This is a Bazaar control directory. -Do not change any files in this directory. -See http://bazaar.canonical.com/ for more information about Bazaar. diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/repository/format granite-0.0.1/.bzr/repository/format --- granite-0.0.1~bzr35~natty3~0/.bzr/repository/format 2011-06-18 08:28:47.000000000 +0000 +++ granite-0.0.1/.bzr/repository/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Bazaar repository format 2a (needs bzr 1.16 or later) Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.cix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.cix differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.iix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.iix differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.rix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.rix differ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.six granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.six --- granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.six 2011-06-24 07:51:06.000000000 +0000 +++ granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.six 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -B+Tree Graph Index 2 -node_ref_lists=0 -key_elements=1 -len=0 -row_lengths= Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.tix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/946e76d6e4192568e6fbb82584832782.tix differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.cix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.cix differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.iix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.iix differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.rix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.rix differ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.six granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.six --- granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.six 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.six 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -B+Tree Graph Index 2 -node_ref_lists=0 -key_elements=1 -len=0 -row_lengths= Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.tix and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/indices/e4784d49d8e05eba3356ea6fd4310a70.tix differ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzr/repository/pack-names granite-0.0.1/.bzr/repository/pack-names --- granite-0.0.1~bzr35~natty3~0/.bzr/repository/pack-names 2011-06-24 07:51:06.000000000 +0000 +++ granite-0.0.1/.bzr/repository/pack-names 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -B+Tree Graph Index 2 -node_ref_lists=0 -key_elements=1 -len=2 -row_lengths=1 -x˹C! @bP Hz\ "'}u{XSE;dBCZM B 85f:|Ƙ \sp \ No newline at end of file Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/packs/946e76d6e4192568e6fbb82584832782.pack and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/packs/946e76d6e4192568e6fbb82584832782.pack differ Binary files /tmp/2Y2x13gOBO/granite-0.0.1~bzr35~natty3~0/.bzr/repository/packs/e4784d49d8e05eba3356ea6fd4310a70.pack and /tmp/DceZstIxjg/granite-0.0.1/.bzr/repository/packs/e4784d49d8e05eba3356ea6fd4310a70.pack differ diff -Nru granite-0.0.1~bzr35~natty3~0/.bzrignore granite-0.0.1/.bzrignore --- granite-0.0.1~bzr35~natty3~0/.bzrignore 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/.bzrignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -build -install.sh diff -Nru granite-0.0.1~bzr35~natty3~0/debian/bzr-builder.manifest granite-0.0.1/debian/bzr-builder.manifest --- granite-0.0.1~bzr35~natty3~0/debian/bzr-builder.manifest 1970-01-01 00:00:00.000000000 +0000 +++ granite-0.0.1/debian/bzr-builder.manifest 2011-07-02 13:25:02.000000000 +0000 @@ -0,0 +1,3 @@ +# bzr-builder format 0.3 deb-version {debupstream}-0~38 +lp:granite revid:maxwell@elementaryos.org-20110625132808-bxai9mp79uswqx3m +nest packaging lp:~xapantu/granite/packaging debian revid:xapantu@gmail.com-20110702132102-p5k4m4iyy5b9maoa diff -Nru granite-0.0.1~bzr35~natty3~0/debian/changelog granite-0.0.1/debian/changelog --- granite-0.0.1~bzr35~natty3~0/debian/changelog 2011-06-24 09:00:53.000000000 +0000 +++ granite-0.0.1/debian/changelog 2011-07-02 13:25:02.000000000 +0000 @@ -1,3 +1,15 @@ +granite (0.0.1-0~38~natty1) natty; urgency=low + + * Auto build. + + -- xapantu Sat, 02 Jul 2011 13:25:02 +0000 + +granite (0.0.1-1ubuntu2) natty; urgency=low + + * Fix vapi, it wasn't in the package + + -- xapantu Sat, 02 Jul 2011 15:14:02 +0200 + granite (0.0.1~bzr35~natty3~0-1ubuntu1) natty; urgency=low * Fix build-deps diff -Nru granite-0.0.1~bzr35~natty3~0/debian/control granite-0.0.1/debian/control --- granite-0.0.1~bzr35~natty3~0/debian/control 2011-06-24 09:02:23.000000000 +0000 +++ granite-0.0.1/debian/control 2011-07-02 13:25:02.000000000 +0000 @@ -11,11 +11,11 @@ Package: libgranite-dev Section: libdevel Architecture: any -Depends: libgranite (= ${binary:Version}) +Depends: libgranite0 (= ${binary:Version}) Description: -Package: libgranite +Package: libgranite0 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} diff -Nru granite-0.0.1~bzr35~natty3~0/debian/libgranite-dev.install granite-0.0.1/debian/libgranite-dev.install --- granite-0.0.1~bzr35~natty3~0/debian/libgranite-dev.install 2011-06-24 07:54:59.000000000 +0000 +++ granite-0.0.1/debian/libgranite-dev.install 2011-07-02 13:25:02.000000000 +0000 @@ -2,3 +2,5 @@ usr/lib/lib*.a usr/lib/lib*.so usr/lib/pkgconfig/* +usr/share/vala/vapi/*.vapi +usr/share/vala/vapi/*.deps diff -Nru granite-0.0.1~bzr35~natty3~0/debian/source/format granite-0.0.1/debian/source/format --- granite-0.0.1~bzr35~natty3~0/debian/source/format 2011-07-02 13:36:59.000000000 +0000 +++ granite-0.0.1/debian/source/format 2011-07-02 13:36:59.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru granite-0.0.1~bzr35~natty3~0/lib/CMakeLists.txt granite-0.0.1/lib/CMakeLists.txt --- granite-0.0.1~bzr35~natty3~0/lib/CMakeLists.txt 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/lib/CMakeLists.txt 2011-07-02 13:25:02.000000000 +0000 @@ -1,7 +1,7 @@ set (PKGNAME granite) set (PKGNAME_ GRANITE) -set (${PKGNAME_}_VERSION 0.1) # increase when you broke the API -set (${PKGNAME_}_SOVERSION 0) # Increase when you add a functionality +set (${PKGNAME_}_VERSION 0.1.1) # increase when you break the API +set (${PKGNAME_}_SOVERSION 0) # Increase when you add functionality # # granite.pc # @@ -93,8 +93,8 @@ 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 --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 --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 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=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=Granite --package-version=0.1 --force) +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=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=Granite --package-version=0.1.1 --force) diff -Nru granite-0.0.1~bzr35~natty3~0/lib/Widgets/AppMenu.vala granite-0.0.1/lib/Widgets/AppMenu.vala --- granite-0.0.1~bzr35~natty3~0/lib/Widgets/AppMenu.vala 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/lib/Widgets/AppMenu.vala 2011-07-02 13:25:02.000000000 +0000 @@ -17,19 +17,37 @@ using Gtk; +using Granite.Services; + namespace Granite.Widgets { public class AppMenu : ToolButtonWithMenu { - public AppMenu.from_stock (string stock_image, IconSize size, string label, Menu menu) { - base.from_stock(stock_image, size, label, menu); - } - - public AppMenu (Image image, string label, Menu menu) { - base (image, label, menu); + public AppMenu (Menu menu) { + + var help_item = new MenuItem.with_label (_("Get Help Online...")); + var translate_item = new MenuItem.with_label (_("Translate This Application...")); + var report_item = new MenuItem.with_label (_("Report a Problem...")); + var about_item = new MenuItem.with_label (_("About")); + + if (menu.get_children ().length () > 0) + menu.append (new SeparatorMenuItem ()); + menu.append (help_item); + menu.append (translate_item); + menu.append (report_item); + menu.append (new SeparatorMenuItem ()); + menu.append (about_item); + + base (new Image.from_stock (Stock.PROPERTIES, IconSize.MENU), _("Menu"), menu); + + help_item.activate.connect(() => System.open_uri (AppFactory.app.help_url)); + translate_item.activate.connect(() => System.open_uri (AppFactory.app.translate_url)); + report_item.activate.connect(() => System.open_uri (AppFactory.app.bug_url)); + about_item.activate.connect (AppFactory.app.show_about); } } } + diff -Nru granite-0.0.1~bzr35~natty3~0/lib/Widgets/ToolButtonWithMenu.vala granite-0.0.1/lib/Widgets/ToolButtonWithMenu.vala --- granite-0.0.1~bzr35~natty3~0/lib/Widgets/ToolButtonWithMenu.vala 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/lib/Widgets/ToolButtonWithMenu.vala 2011-07-02 13:25:02.000000000 +0000 @@ -1,5 +1,5 @@ // -// Copyright (C) 2011 Mathijs Henquet +// Copyright (C) 2011 Avi Romanoff // // 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 @@ -14,196 +14,38 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . // -// -// Authors: -// Mathijs Henquet -// ammonkey -// - -/* - * ToolButtonWithMenu - * - support long click / right click with depressed button states - * - activate a GtkAction if any or popup a menu. - * (used in history navigation buttons next/prev, appmenu) - */ using Gtk; using Gdk; namespace Granite.Widgets { - public class ToolButtonWithMenu : ToggleToolButton { + public class ToolButtonWithMenu : Gtk.ToggleToolButton { - public Gtk.Action? myaction; + public Menu menu { get; protected set; } + protected PositionType menu_orientation; - public delegate Menu MenuFetcher (); - - private int long_press_time = Gtk.Settings.get_default ().gtk_double_click_time * 2; - private int menu_width = 200; - private Button button; - public ulong toggled_sig_id; - private int timeout = -1; - private uint last_click_time = -1; - - private PositionType _menu_orientation; - public PositionType menu_orientation { - get { return _menu_orientation; } - set { - var orientation = value; - switch (orientation) { - case PositionType.TOP: - case PositionType.BOTTOM: - orientation = PositionType.LEFT; - break; - } - _menu_orientation = orientation; - } - } - - public signal void right_click (Gdk.EventButton ev); - - private bool has_fetcher = false; - private MenuFetcher _fetcher; - public MenuFetcher fetcher { - get { return _fetcher; } - set { - _fetcher = value; - has_fetcher = true; - } - } - - private Menu _menu; - public Menu menu { - get { return _menu; } - set { - if(has_fetcher) - warning ("Don't set the menu property on a ToolMenuButton when there is already a menu fetcher"); - else { - _menu = value; - update_menu_properties(); - } - } - } - - public ToolButtonWithMenu.from_action (Gtk.Action action) { - - this.from_stock (action.stock_id, IconSize.MENU, action.label, new Menu ()); - - use_action_appearance = true; - - set_related_action (action); - - action.connect_proxy (this); - myaction = action; - } - - public ToolButtonWithMenu.from_stock (string stock_image, IconSize size, string label, Menu menu) { - Image image = new Image.from_stock(stock_image, size); - this (image, label, menu); - } - - private void update_menu_properties () { - - if (menu_orientation == PositionType.RIGHT) - menu.set_size_request(menu_width, -1); + public ToolButtonWithMenu (Image image, string label, Menu menu, PositionType menu_orientation = Gtk.PositionType.LEFT) + requires (menu_orientation == PositionType.LEFT || menu_orientation == PositionType.RIGHT) { - menu.attach_to_widget (this, null); - menu.deactivate.connect(deactivate_menu); - menu.deactivate.connect(popdown_menu); - } - - public ToolButtonWithMenu (Image image, string label, Menu _menu, Gtk.PositionType _menu_orientation = Gtk.PositionType.LEFT) { - - this.menu_orientation = _menu_orientation; - + this.menu_orientation = menu_orientation; icon_widget = image; label_widget = new Label (label); ((Label) label_widget).use_underline = true; - can_focus = true; - set_tooltip_text (label); - - menu = _menu; - - mnemonic_activate.connect (on_mnemonic_activate); - - button = (Button) get_child(); - button.events |= EventMask.BUTTON_PRESS_MASK - | EventMask.BUTTON_RELEASE_MASK; - - button.button_press_event.connect (on_button_press_event); - button.button_release_event.connect (on_button_release_event); - } - - public override void show_all () { - menu.show_all(); - base.show_all(); - } - - private void deactivate_menu () { - - if (myaction != null) - myaction.block_activate (); - active = false; - if (myaction != null) - myaction.unblock_activate (); - } - - private void popup_menu_and_depress_button () { - - if (myaction != null) - myaction.block_activate (); - - active = true; - if (myaction != null) - myaction.unblock_activate (); - - popup_menu(); - } - - private bool on_button_release_event (Gdk.EventButton ev) { - - if (ev.time - last_click_time < long_press_time) { - if (myaction != null) - myaction.activate (); - else { - active = true; - popup_menu(); - } - } - - if (timeout != -1) { - Source.remove ((uint) timeout); - timeout = -1; - } - - return true; - } - - private bool on_button_press_event (Gdk.EventButton ev) { - - if (timeout == -1 && ev.button == 1) { - last_click_time = ev.time; - timeout = (int) Timeout.add (long_press_time, () => { - /* long click */ - timeout = -1; - popup_menu_and_depress_button (); - return false; - }); - } - - if (ev.button == 3) { - /* right_click */ - right_click(ev); - if (myaction != null) - popup_menu_and_depress_button (); - } + this.menu = menu; + menu.attach_to_widget (this, null); + menu.deactivate.connect(() => { + active = false; + }); - return true; + mnemonic_activate.connect (on_mnemonic_activate); + menu.deactivate.connect (popdown_menu); + clicked.connect (on_clicked); } private bool on_mnemonic_activate (bool group_cycling) { - //stdout.printf ("on mnemonic activate\n"); + // ToggleButton always grabs focus away from the editor, // so reimplement Widget's version, which only grabs the // focus if we are group cycling. @@ -215,24 +57,18 @@ return true; } - protected new void popup_menu (Gdk.EventButton? ev = null) { + protected new void popup_menu (EventButton? event) { - if (has_fetcher) - fetch_menu (); - - menu.select_first (true); - try { - for (int i = 0; i < 2; i++) { - // Update the menu's size, then show it - menu.popup (null, null, get_menu_position, - (ev == null) ? 0 : ev.button, - (ev == null) ? get_current_event_time() : ev.time); - } + menu.popup (null, + null, + position_menu, + (event == null) ? 0 : event.button, + (event == null) ? get_current_event_time () : event.time); } finally { // Highlight the parent if (menu.attach_widget != null) - menu.attach_widget.set_state(StateType.SELECTED); + menu.attach_widget.set_state (StateType.SELECTED); } } @@ -242,18 +78,21 @@ // Unhighlight the parent if (menu.attach_widget != null) - menu.attach_widget.set_state(Gtk.StateType.NORMAL); + menu.attach_widget.set_state (StateType.NORMAL); + } + + public override void show_all () { + base.show_all (); + menu.show_all (); } - private void fetch_menu() { - _menu = fetcher(); - update_menu_properties(); + private void on_clicked () { + popup_menu (null); } - private void get_menu_position (Menu menu, out int x, out int y, out bool push_in) { + protected virtual void position_menu (Menu menu, out int x, out int y, out bool push_in) { - if (menu.attach_widget == null || - menu.attach_widget.get_window() == null) { + if (menu.attach_widget == null || menu.attach_widget.get_window () == null) { // Prevent null exception in weird cases x = 0; y = 0; @@ -264,25 +103,15 @@ menu.attach_widget.get_window ().get_origin (out x, out y); Allocation allocation; menu.attach_widget.get_allocation (out allocation); - Allocation menu_allocation; - menu.get_allocation (out menu_allocation); - x += allocation.x; - - if (menu_orientation == PositionType.RIGHT) { - x += allocation.width; - x -= menu_width; - } else { - x += allocation.width / 2; - x -= menu_allocation.width / 2; - } - y += allocation.y + 4; + x += allocation.x; + y += allocation.y; int width, height; menu.get_size_request (out width, out height); - if (y + height >= menu.attach_widget.get_screen().get_height()) + if (y + height >= menu.attach_widget.get_screen ().get_height ()) y -= height; else y += allocation.height; diff -Nru granite-0.0.1~bzr35~natty3~0/po/granite.pot granite-0.0.1/po/granite.pot --- granite-0.0.1~bzr35~natty3~0/po/granite.pot 2011-06-18 08:28:54.000000000 +0000 +++ granite-0.0.1/po/granite.pot 2011-07-02 13:25:02.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-13 12:52+0200\n" +"POT-Creation-Date: 2011-06-25 08:16-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,10 +17,30 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: /home/xapantu/Dev/granite/po/../lib/Widgets/DatePicker.vala:40 +#: ../lib/Widgets/DatePicker.vala:40 msgid "%B %e, %Y" msgstr "" -#: /home/xapantu/Dev/granite/po/../lib/Widgets/TimePicker.vala:30 +#: ../lib/Widgets/TimePicker.vala:30 msgid "%l:%M %p" msgstr "" + +#: ../lib/Widgets/AppMenu.vala:31 +msgid "About" +msgstr "" + +#: ../lib/Widgets/AppMenu.vala:28 +msgid "Get Help Online..." +msgstr "" + +#: ../lib/Widgets/AppMenu.vala:40 +msgid "Menu" +msgstr "" + +#: ../lib/Widgets/AppMenu.vala:30 +msgid "Report a Problem..." +msgstr "" + +#: ../lib/Widgets/AppMenu.vala:29 +msgid "Translate This Application..." +msgstr ""