Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-09 14:57:33 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-09 14:57:33 (GMT)
commitcd4681df86138c1bc5fd5f3a29ecbbf81011d9ca (patch)
tree56e8750b4dd0dc97880dcee40c7a5fc43d735695
parent7e92df4c485e83eefe23a78c2d4046b660f1db8a (diff)
Fix the resizing issue, and start porting the NickList
-rw-r--r--purk/events.py2
-rw-r--r--purk/widgets.py16
-rw-r--r--purk/windows.py22
3 files changed, 16 insertions, 24 deletions
diff --git a/purk/events.py b/purk/events.py
index 31e1882..4142003 100644
--- a/purk/events.py
+++ b/purk/events.py
@@ -31,7 +31,7 @@ def trigger(e_name, e_data=None, **kwargs):
if e_data is None:
e_data = data(**kwargs)
- print 'Event:', e_name, e_data
+ #print 'Event:', e_name, e_data
failure = True
error = None
diff --git a/purk/widgets.py b/purk/widgets.py
index 9ab8c52..c870a85 100644
--- a/purk/widgets.py
+++ b/purk/widgets.py
@@ -110,7 +110,7 @@ def menu_from_list(alist):
last = item
class Nicklist(Gtk.TreeView):
- def click(self, event):
+ def click(self, widget, event):
if event.button == 3:
x, y = event.get_coords()
@@ -119,7 +119,7 @@ class Nicklist(Gtk.TreeView):
c_data = self.events.data(window=self.win, data=self[data], menu=[])
self.events.trigger("ListRightClick", c_data)
-
+
if c_data.menu:
menu = Gtk.Menu()
for item in menu_from_list(c_data.menu):
@@ -180,7 +180,7 @@ class Nicklist(Gtk.TreeView):
def clear(self):
self.get_model().clear()
-
+
def __iter__(self):
return (r[0] for r in self.get_model())
@@ -193,7 +193,7 @@ class Nicklist(Gtk.TreeView):
self.set_headers_visible(False)
self.set_property("fixed-height-mode", True)
- self.connect("button-press-event", Nicklist.click)
+ self.connect("button-press-event", self.click)
self.connect_after("button-release-event", lambda *a: True)
style_me(self, "nicklist")
@@ -503,9 +503,8 @@ class TextOutput(Gtk.TextView):
self.hover_coords = widget.get_coords()
def mouseup(self, widget, event):
- print widget, event
if not self.get_buffer().get_selection_bounds():
- if widget.button == 1:
+ if event.button == 1:
hover_iter = get_iter_at_coords(self, *self.hover_coords)
if not hover_iter.ends_line():
@@ -592,11 +591,6 @@ class TextOutput(Gtk.TextView):
self.core = core
self.events = core.events
self.win = window
-
- self.set_size_request(0 , -1)
-
- self.set_property("left-margin", 3)
- self.set_property("right-margin", 3)
self.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)
self.set_editable(False)
diff --git a/purk/windows.py b/purk/windows.py
index 8ac436f..11903dd 100644
--- a/purk/windows.py
+++ b/purk/windows.py
@@ -135,7 +135,7 @@ class Window(Gtk.VBox):
else:
self.output = widgets.TextOutput(core, self)
self.buffer = self.output.get_buffer()
-
+
if hasattr(self, "input"):
if self.input.parent:
self.input.parent.remove(self.input)
@@ -160,13 +160,13 @@ class SimpleWindow(Window):
self.focus = self.input.grab_focus
self.connect("key-press-event", self.transfer_text)
- self.pack_end(self.input, True, False, 0)
-
+ self.pack_end(self.input, expand=False)
+
topbox = Gtk.ScrolledWindow()
- topbox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
+ topbox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
topbox.add(self.output)
- self.pack_end(topbox, True, False, 0)
+ self.pack_end(topbox)
self.show_all()
@@ -196,10 +196,10 @@ class StatusWindow(Window):
self.pack_end(botbox, False, True, 0)
topbox = Gtk.ScrolledWindow()
- topbox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
+ topbox.set_vexpand(True)
topbox.add(self.output)
- self.pack_end(topbox, False, True, 0)
+ self.pack_end(topbox, True, True, 0)
self.show_all()
@@ -236,7 +236,7 @@ def move_nicklist(paned, event):
)
def drop_nicklist(paned, event):
- width = paned.allocation.width
+ width = paned.get_allocated_width()
pos = paned.get_position()
double_click, nicklist_pos = paned._moving
@@ -280,12 +280,10 @@ class ChannelWindow(Window):
nlbox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
nlbox.add(self.nicklist)
- nlbox.set_size_request(conf.get("ui-gtk/nicklist-width", 112), -1)
-
botbox = Gtk.HBox()
botbox.add(self.input)
botbox.pack_end(self.nick_label, False, True, 0)
-
+
self.pack_end(botbox, False, True, 0)
pane = Gtk.HPaned()
@@ -297,7 +295,7 @@ class ChannelWindow(Window):
pane.connect("button-press-event", move_nicklist)
pane.connect("button-release-event", drop_nicklist)
- self.pack_end(pane, False, True, 0)
+ self.pack_end(pane, True, True, 0)
self.show_all()
def is_channel(self):