Merged with trunk
This commit is contained in:
commit
e67c092600
@ -130,4 +130,11 @@ class EditableLabel(gtk.EventBox):
|
|||||||
"""Set the label foreground"""
|
"""Set the label foreground"""
|
||||||
self._label.modify_fg(state, color)
|
self._label.modify_fg(state, color)
|
||||||
|
|
||||||
|
def is_custom(self):
|
||||||
|
"""Return whether or not we have a custom string set"""
|
||||||
|
return(self._custom)
|
||||||
|
|
||||||
|
def set_custom(self):
|
||||||
|
"""Set the customness of the string to True"""
|
||||||
|
self._custom = True
|
||||||
gobject.type_register(EditableLabel)
|
gobject.type_register(EditableLabel)
|
||||||
|
@ -45,7 +45,7 @@ class Notebook(Container, gtk.Notebook):
|
|||||||
# the new order of terminals. We probably need to preserve this for
|
# the new order of terminals. We probably need to preserve this for
|
||||||
# navigation to next/prev terminals.
|
# navigation to next/prev terminals.
|
||||||
#self.connect('page-reordered', self.on_page_reordered)
|
#self.connect('page-reordered', self.on_page_reordered)
|
||||||
self.set_property('homogeneous', not self.config['scroll_tabbar'])
|
self.set_property('homogeneous', True)
|
||||||
self.set_scrollable(self.config['scroll_tabbar'])
|
self.set_scrollable(self.config['scroll_tabbar'])
|
||||||
|
|
||||||
pos = getattr(gtk, 'POS_%s' % self.config['tab_position'].upper())
|
pos = getattr(gtk, 'POS_%s' % self.config['tab_position'].upper())
|
||||||
@ -405,12 +405,14 @@ class TabLabel(gtk.HBox):
|
|||||||
"""Update the angle of a label"""
|
"""Update the angle of a label"""
|
||||||
position = self.notebook.get_tab_pos()
|
position = self.notebook.get_tab_pos()
|
||||||
if position == gtk.POS_LEFT:
|
if position == gtk.POS_LEFT:
|
||||||
self.set_orientation(gtk.ORIENTATION_VERTICAL)
|
if hasattr(self, 'set_orientation'):
|
||||||
|
self.set_orientation(gtk.ORIENTATION_VERTICAL)
|
||||||
self.label.set_angle(90)
|
self.label.set_angle(90)
|
||||||
elif position == gtk.POS_RIGHT:
|
elif position == gtk.POS_RIGHT:
|
||||||
self.label.set_angle(270)
|
self.label.set_angle(270)
|
||||||
else:
|
else:
|
||||||
self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
|
if hasattr(self, 'set_orientation'):
|
||||||
|
self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
|
||||||
self.label.set_angle(0)
|
self.label.set_angle(0)
|
||||||
|
|
||||||
def on_close(self, _widget):
|
def on_close(self, _widget):
|
||||||
|
@ -1249,6 +1249,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
|||||||
|
|
||||||
def get_cursor_position(self):
|
def get_cursor_position(self):
|
||||||
"""Return the co-ordinates of our cursor"""
|
"""Return the co-ordinates of our cursor"""
|
||||||
|
# FIXME: THIS METHOD IS DEPRECATED AND UNUSED
|
||||||
col, row = self.vte.get_cursor_position()
|
col, row = self.vte.get_cursor_position()
|
||||||
width = self.vte.get_char_width()
|
width = self.vte.get_char_width()
|
||||||
height = self.vte.get_char_height()
|
height = self.vte.get_char_height()
|
||||||
@ -1282,6 +1283,9 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
|||||||
if layout != "default":
|
if layout != "default":
|
||||||
# There's no point explicitly noting default profiles
|
# There's no point explicitly noting default profiles
|
||||||
layout['profile'] = profile
|
layout['profile'] = profile
|
||||||
|
title = self.titlebar.get_custom_string()
|
||||||
|
if title:
|
||||||
|
layout['title'] = title
|
||||||
name = 'terminal%d' % count
|
name = 'terminal%d' % count
|
||||||
count = count + 1
|
count = count + 1
|
||||||
global_layout[name] = layout
|
global_layout[name] = layout
|
||||||
@ -1298,6 +1302,8 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
|||||||
# This doesn't need/use self.titlebar, but it's safer than sending
|
# This doesn't need/use self.titlebar, but it's safer than sending
|
||||||
# None
|
# None
|
||||||
self.really_create_group(self.titlebar, layout['group'])
|
self.really_create_group(self.titlebar, layout['group'])
|
||||||
|
if layout.has_key('title') and layout['title'] != '':
|
||||||
|
self.titlebar.set_custom_string(layout['title'])
|
||||||
|
|
||||||
# There now begins a great list of keyboard event handlers
|
# There now begins a great list of keyboard event handlers
|
||||||
def key_zoom_in(self):
|
def key_zoom_in(self):
|
||||||
|
@ -244,4 +244,16 @@ class Titlebar(gtk.EventBox):
|
|||||||
self.bellicon.hide()
|
self.bellicon.hide()
|
||||||
return(False)
|
return(False)
|
||||||
|
|
||||||
|
def get_custom_string(self):
|
||||||
|
"""If we have a custom string set, return it, otherwise None"""
|
||||||
|
if self.label.is_custom():
|
||||||
|
return(self.label.get_text())
|
||||||
|
else:
|
||||||
|
return(None)
|
||||||
|
|
||||||
|
def set_custom_string(self, string):
|
||||||
|
"""Set a custom string"""
|
||||||
|
self.label.set_text(string)
|
||||||
|
self.label.set_custom()
|
||||||
|
|
||||||
gobject.type_register(Titlebar)
|
gobject.type_register(Titlebar)
|
||||||
|
@ -671,9 +671,10 @@ class Window(Container, gtk.Window):
|
|||||||
|
|
||||||
if len(winners) > 1:
|
if len(winners) > 1:
|
||||||
# Break an n-way tie using the cursor position
|
# Break an n-way tie using the cursor position
|
||||||
cursor_x, cursor_y = terminal.get_cursor_position()
|
term_alloc = terminal.allocation
|
||||||
cursor_x = cursor_x + allocation.x
|
cursor_x = term_alloc.x + term_alloc.width / 2
|
||||||
cursor_y = cursor_y + allocation.y
|
cursor_y = term_alloc.y + term_alloc.height / 2
|
||||||
|
|
||||||
for term in winners:
|
for term in winners:
|
||||||
rect = layout[term]
|
rect = layout[term]
|
||||||
if util.get_nav_tiebreak(direction, cursor_x, cursor_y,
|
if util.get_nav_tiebreak(direction, cursor_x, cursor_y,
|
||||||
|
Loading…
Reference in New Issue
Block a user