Merge lp:~elementary-dev-community/granite/fix-1184312 into lp:~elementary-pantheon/granite/granite

Proposed by Jesse Cheun
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~elementary-dev-community/granite/fix-1184312
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 213 lines (+112/-3)
2 files modified
demo/GraniteDemo.vala (+3/-0)
lib/Widgets/DynamicNotebook.vala (+109/-3)
To merge this branch: bzr merge lp:~elementary-dev-community/granite/fix-1184312
Reviewer Review Type Date Requested Status
Danielle Foré Needs Fixing
David Gomes (community) Needs Fixing
Review via email: mp+226568@code.launchpad.net

Description of the change

Added double click to rename tab in DynamicNotebook. Edited GraniteDemo app to test tab renaming.

To post a comment you must log in.
750. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

751. By xapantu

Merge Phillip's branch, catalog upate

752. By Danielle Foré

fix cmakelists.txt to install open-menu icon

753. By Cody Garver

Update translation template

754. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

755. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

756. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

757. By Danielle Foré

Remove all the custom drawing code in in Granite's About dialog

758. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

759. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

Revision history for this message
David Gomes (davidgomes) wrote :

Pressing Escape should exit the text box.

review: Needs Fixing
Revision history for this message
David Gomes (davidgomes) wrote :

Also, a lot of flaws in your code style.

Check http://elementaryos.org/docs/code/code-style/. If you change the branch ownership to ~elementary-dev-community I'll gladly fix all the code for you.

review: Needs Fixing
760. By Niclas Lockner

Implements show_icon property in tab objects which allows for correct icon visibility state after changing the 'working' property of a given tab.

Revision history for this message
Jesse Cheun (jcheun93) wrote :

Hey thanks for reviewing my code. I added the option to close the entry box when the escape key is pressed. I also fixed all the code style error I could find. The branch ownership has been changed to ~elementary-dev-community so you can edit the code if needed.

761. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

762. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

763. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

764. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

765. By xapantu

Merge Olivier Duchateau's patch, via Cameron Norman's branch: Support BSD systems (prctl, setproctitle)

766. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

767. By Cody Garver

Updated translation template

768. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

769. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

770. By Cody Garver

"Translate This App" → "Suggest Translations"

771. By Cody Garver

Updated translation template

772. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

773. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

774. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

775. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

776. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

777. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

778. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

779. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

780. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

781. By xapantu

Solve crash when using the --about command line parameter by avoiding improper type casting.

782. By Rico Tzschichholz

Follow gtk+ binding updates and fix build with valac >= 0.25.2

783. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

784. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

785. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

786. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

787. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

788. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

789. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

790. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

791. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

792. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

793. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

794. By Rico Tzschichholz

DynamicNotebook: Fix destructor name

795. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

796. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

797. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

798. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

799. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

800. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

801. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

802. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

803. By Cody Garver

Only use copyright symbol ©, not actual word 'Copyright' (lp:1358969)

804. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

805. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

806. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

807. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

808. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

809. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

810. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

811. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

812. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

813. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

814. By Tom Beckmann

Adapt to standard style for copyright headers, add VAPI_COMMENTS option to cmake

815. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

816. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

817. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

818. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

819. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

820. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

821. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

822. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

823. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

824. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

825. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

826. By Sergey Zolotarev

Prevent notebook tabs from stealing focus (lp:1395686)

827. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

828. By Cody Garver

Deprecate Granite.ThinPaned in favor of Gtk.Paned

829. By Fabio Zaramella

Wrap long Welcome subtitles and descriptions

830. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

831. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

832. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

833. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

834. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

835. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

836. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

837. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

838. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

839. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

840. By Corentin Noël

[CellRendererExpander] Gtk+ 3.14 now uses Gtk.StateFlags.CHECKED instead of Gtk.StateFlags.ACTIVE.

841. By Cody Garver

CMake: bump minimum version of Gtk to >= 3.14

842. By Corentin Noël

Adds the deprecation annotation to deprecate widgets officially.
[WrapLabel] No need for this widget when Gtk.Label provides wrapping label.
[PopOver] Replaced by Gtk.Popover.

Fixed some deprecations annotations as we deprecate widgets when they are available in Gtk.

843. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

844. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

845. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

846. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

847. By Victor Martinez

ContractorView: Fix error when building with vala 0.28

848. By Djax

Increase max-tab width for dynamic notebook tabs by 24px

849. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

850. By Artem Anufrij

Functionality for changing label, description and icon of a welcome screen button after creating them. (lp:1403647)

851. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

852. By Corentin Noël

Use GObject style for creating the Welcome widget.
Style changes to the WelcomeButton.

853. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

854. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

855. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

856. By Cody Garver

Install a basic .desktop for granite-demo

857. By Corentin Noël

Granite Demo rewrite, removed deprecated widgets.

858. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

859. By Corentin Noël

New AlertView widget

860. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

861. By Corentin Noël

New widget StorageBar

862. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

863. By xapantu

Update the patch to avoid conflicts with latest trunk

864. By xapantu

Minor cosmetics

Revision history for this message
xapantu (xapantu) wrote :

Thanks for your patch, I just updated it to work with latest trunk, we are going to merge this sooner or later :)

Revision history for this message
Danielle Foré (danrabbit) wrote :

If you're in edit mode and double click (to select all the text), it will reset its contents to the last saved contents.

Clicking outside the entry should save (like it does in the file manager)

review: Needs Fixing

Unmerged revisions

864. By xapantu

Minor cosmetics

863. By xapantu

Update the patch to avoid conflicts with latest trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'demo/GraniteDemo.vala'
2--- demo/GraniteDemo.vala 2015-06-16 17:39:23 +0000
3+++ demo/GraniteDemo.vala 2015-08-14 20:32:19 +0000
4@@ -269,9 +269,12 @@
5 notebook.new_tab_requested.connect (() => {
6 var page = new Gtk.Label ("Page %d".printf (i));
7 var tab = new Granite.Widgets.Tab ("Tab %d".printf (i), new ThemedIcon ("mail-mark-important-symbolic"), page);
8+ tab.restore_data = i.to_string ();
9 notebook.insert_tab (tab, i-1);
10 i++;
11 });
12+
13+ notebook.allow_edit = true;
14 }
15
16 public static int main (string[] args) {
17
18=== modified file 'lib/Widgets/DynamicNotebook.vala'
19--- lib/Widgets/DynamicNotebook.vala 2015-03-25 21:40:53 +0000
20+++ lib/Widgets/DynamicNotebook.vala 2015-08-14 20:32:19 +0000
21@@ -89,6 +89,12 @@
22 _pinnable = value;
23 }
24 }
25+
26+ private bool _editable = false;
27+ public bool editable {
28+ get { return _editable; }
29+ set { _editable = value; }
30+ }
31
32 /**
33 * Data which will be kept once the tab is deleted, and which will be used by
34@@ -96,7 +102,12 @@
35 * the tab should not be restored.
36 **/
37 public string restore_data { get; set; }
38-
39+
40+ /* Store the default tab title */
41+ public string default_title { get; set; }
42+ public bool edited { get; set; }
43+ private bool entry_menu_popup = false;
44+
45 /**
46 * An optional delegate that is called when the tab is dropped from the set
47 * of restorable tabs in DynamicNotebook.
48@@ -191,7 +202,7 @@
49 update_close_button_visibility ();
50 }
51 }
52-
53+
54 private bool cursor_over_tab = false;
55 private bool cursor_over_close_button = false;
56 private Gtk.Revealer close_button_revealer;
57@@ -212,6 +223,12 @@
58 padding: 0;
59 }
60 """;
61+
62+ private static const string ENTRY_STYLE = """
63+ * {
64+ padding: 1px;
65+ }
66+ """;
67
68 public Tab (string label="", GLib.Icon? icon=null, Gtk.Widget? page=null) {
69 this._label = new Gtk.Label (label);
70@@ -235,10 +252,72 @@
71 close_button_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE;
72 close_button_revealer.add (close_button);
73
74+ /* Entry box to edit tab title */
75+ var entry_box = new Gtk.Entry ();
76+ entry_box.hexpand = true;
77+
78+ Utils.set_theming (entry_box, ENTRY_STYLE, null,
79+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
80+
81+ /* Set tab title and close entry box */
82+ entry_box.activate.connect (() => {
83+ this.visible_window = true;
84+ edited = (default_title != entry_box.get_text ());
85+ if (entry_box.get_text () == "") {
86+ this.label = default_title;
87+ edited = false;
88+ } else {
89+ this.label = entry_box.get_text ();
90+ }
91+ _label.visible = true;
92+ entry_box.hide ();
93+ });
94+
95+ /* checks if popup menu has been populated */
96+ entry_box.populate_popup.connect (() => {
97+ entry_menu_popup = true;
98+ });
99+
100+ /* Allow right clicks and close entry_box if out of foucs */
101+ entry_box.focus_out_event.connect (() => {
102+ // prevent right click popup menu from closing entry
103+ if (entry_menu_popup) {
104+ entry_menu_popup = false;
105+ } else {
106+ this.visible_window = true;
107+ _label.visible = true;
108+ entry_box.hide ();
109+ }
110+ return false;
111+ });
112+
113+ /* Close entry box on escape key press */
114+ entry_box.key_press_event.connect ((e) => {
115+ if (e.keyval == Gdk.Key.Escape) {
116+ this.visible_window = true;
117+
118+ /* Uncomment if tab should save new string on escape */
119+ /* edited = (default_title != entry_box.get_text ());
120+
121+ if (entry_box.get_text () == "") {
122+ this.label = default_title;
123+ edited = false;
124+ } else {
125+ this.label = entry_box.get_text ();
126+ } */
127+
128+ _label.visible = true;
129+ entry_box.hide ();
130+ return true;
131+ }
132+ return false;
133+ });
134+
135 var tab_layout = new Gtk.Grid ();
136 tab_layout.hexpand = false;
137 tab_layout.orientation = Gtk.Orientation.HORIZONTAL;
138 tab_layout.add (close_button_revealer);
139+ tab_layout.add (entry_box);
140 tab_layout.add (_label);
141 tab_layout.add (_icon);
142 tab_layout.add (_working);
143@@ -263,6 +342,9 @@
144 restore_data = "";
145
146 this.show_all ();
147+
148+ entry_box.hide ();
149+ edited = false;
150
151 menu = new Gtk.Menu ();
152 var close_m = new Gtk.MenuItem.with_label (_("Close Tab"));
153@@ -313,6 +395,12 @@
154 this.closed ();
155 } else if (e.button == 2 && e.state == Gdk.ModifierType.SHIFT_MASK && close_button_is_visible ()) {
156 this.close_others ();
157+ } else if (e.button == 1 && e.type == Gdk.EventType.2BUTTON_PRESS && _editable) {
158+ this.visible_window = false;
159+ _label.visible = false;
160+ entry_box.set_text (_label.get_text ());
161+ entry_box.show ();
162+ entry_box.grab_focus ();
163 } else if (e.button == 1 && e.type == Gdk.EventType.2BUTTON_PRESS && duplicate_m.visible) {
164 this.duplicate ();
165 } else if (e.button == 3) {
166@@ -324,6 +412,9 @@
167 if (this.pinned) {
168 pin_m.label = "Unpin";
169 }
170+ // allow double/triple clicks when current tab is focused
171+ } else if (e.button == 1 && e.type == Gdk.EventType.BUTTON_PRESS && _is_current_tab ){
172+ return true;
173 } else {
174 return false;
175 }
176@@ -603,7 +694,6 @@
177 get { return _allow_duplication; }
178 set {
179 _allow_duplication = value;
180-
181 foreach (var tab in tabs) {
182 tab.duplicate_m.visible = value;
183 }
184@@ -622,6 +712,21 @@
185 restore_button.visible = value;
186 }
187 }
188+
189+ /**
190+ * Allow editable tabs
191+ */
192+ bool _allow_edit = false;
193+ public bool allow_edit {
194+ get { return _allow_edit; }
195+ set {
196+ _allow_edit = value;
197+
198+ foreach (var tab in tabs) {
199+ tab.editable= value;
200+ }
201+ }
202+ }
203
204 /**
205 * Set or get the upper limit of the size of the set
206@@ -1150,6 +1255,7 @@
207 this.notebook.set_tab_detachable (tab.page_container, this.allow_new_window);
208
209 tab.show_icon = show_icons;
210+ tab.editable = allow_edit;
211 tab.duplicate_m.visible = allow_duplication;
212 tab.new_window_m.visible = allow_new_window;
213 tab.pin_m.visible = allow_pinning;

Subscribers

People subscribed via source and target branches