Merge lp:~julien-spautz/granite/1157350 into lp:~elementary-pantheon/granite/granite

Proposed by Julien Spautz
Status: Rejected
Rejected by: Julien Spautz
Proposed branch: lp:~julien-spautz/granite/1157350
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 51 lines (+17/-4)
1 file modified
lib/Widgets/DynamicNotebook.vala (+17/-4)
To merge this branch: bzr merge lp:~julien-spautz/granite/1157350
Reviewer Review Type Date Requested Status
Cody Garver (community) Needs Information
David Gomes Pending
Review via email: mp+155123@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

I'm reviewing this together with lp:~julien-spautz/pantheon-terminal/1157350/+merge/155124, so please nobody merge this.

lp:~julien-spautz/granite/1157350 updated
549. By Julien Spautz

don't destroy tabs when they are moved

550. By Julien Spautz

addad a tab_detached and tab_attached signal, since the Gtk.Noteebook is private, and apps can't otherwise connect to drag events

Revision history for this message
Julien Spautz (julien-spautz) wrote :

tab_detached gets emitted _after_ the tab has successfully been dragged to it's destination to be attached to another notebook or to create a new window.

tab_attached gets emitted when a tab has been dropped into the notebook.

This is needed for the terminal fix, but might be useful for other apps, too.

Revision history for this message
Cody Garver (codygarver) wrote :

What's the status of this code? Has it been superseded?

review: Needs Information
Revision history for this message
Julien Spautz (julien-spautz) wrote :

Since xapantu fixed the bug, I guess it's been superseeded.

Revision history for this message
xapantu (xapantu) wrote :

It is the same goal that https://code.launchpad.net/~elementary-apps/granite/dynamicnotebook/+merge/157874 apparently, these two branch should probably be merged into a single branch then.

Unmerged revisions

550. By Julien Spautz

addad a tab_detached and tab_attached signal, since the Gtk.Noteebook is private, and apps can't otherwise connect to drag events

549. By Julien Spautz

don't destroy tabs when they are moved

548. By Julien Spautz

fix bug #1157350 by destroying the container AFTER emitting the tab_moved signal

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/DynamicNotebook.vala'
2--- lib/Widgets/DynamicNotebook.vala 2013-03-21 14:49:42 +0000
3+++ lib/Widgets/DynamicNotebook.vala 2013-03-24 16:50:29 +0000
4@@ -321,7 +321,10 @@
5 public signal void tab_switched (Tab? old_tab, Tab new_tab);
6 public signal void tab_moved (Tab tab, int new_pos, bool new_window, int x, int y);
7 public signal void tab_duplicated (Tab duplicated_tab);
8-
9+ public signal void tab_detached (Tab tab);
10+ public signal void tab_attached (Tab tab);
11+ Tab ?dragged;
12+
13 private static const string CLOSE_BUTTON_STYLE = """
14 * {
15 -GtkButton-default-border : 0;
16@@ -350,6 +353,19 @@
17 this.notebook.scrollable = true;
18 this.notebook.show_border = false;
19
20+ this.notebook.drag_begin.connect (() => {
21+ dragged = current;
22+ });
23+
24+ this.notebook.drag_end.connect (() => {
25+ tab_detached (dragged);
26+ dragged = null;
27+ });
28+
29+ this.notebook.drag_data_received.connect (() => {
30+ tab_attached (current);
31+ });
32+
33 this.draw.connect ( (ctx) => {
34 this.get_style_context ().render_activity (ctx, 0, 0, this.get_allocated_width (), 27);
35 return false;
36@@ -493,8 +509,6 @@
37 unowned Gtk.Notebook on_create_window (Gtk.Widget page, int x, int y) {
38 var tab = notebook.get_tab_label (page) as Tab;
39 notebook.remove_page (notebook.page_num (tab.page_container));
40- tab.page_container.destroy ();
41-
42 tab_moved (tab, 0, true, x, y);
43 return null;
44 }
45@@ -614,7 +628,6 @@
46
47 tab.new_window.connect (() => {
48 notebook.remove_page (notebook.page_num (tab.page_container));
49- tab.page_container.destroy ();
50 tab_moved (tab, 0, true, 0, 0);
51 });
52

Subscribers

People subscribed via source and target branches