Use short titles in breadcrumbs
When possible, try to shorten the screen title to the shortest length possible while still being descriptive enough to help the user navigate. Also, make the space for the ellipses available for use for titles that do not need them. Change-Id: I82e08ac60451e81c2e5a51f8595fb19234f23859
This commit is contained in:
parent
a6689f9e15
commit
37ef05652d
@ -148,9 +148,11 @@ class BreadCrumbBar(urwid.WidgetWrap):
|
|||||||
super(BreadCrumbBar, self).__init__(self.display_widget)
|
super(BreadCrumbBar, self).__init__(self.display_widget)
|
||||||
|
|
||||||
def _get_breadcrumb_text(self, screen):
|
def _get_breadcrumb_text(self, screen):
|
||||||
title = getattr(screen, 'title', str(screen))
|
title = getattr(screen, 'short_title', None)
|
||||||
|
if not title:
|
||||||
|
title = getattr(screen, 'title', str(screen))
|
||||||
text = "%s %s" % (BreadCrumbBar.BREADCRUMB_SYMBOL, title)
|
text = "%s %s" % (BreadCrumbBar.BREADCRUMB_SYMBOL, title)
|
||||||
if len(text) > 20:
|
if len(text) > 23:
|
||||||
text = "%s..." % text[:20]
|
text = "%s..." % text[:20]
|
||||||
return urwid.Text(text, wrap='clip')
|
return urwid.Text(text, wrap='clip')
|
||||||
|
|
||||||
|
@ -256,6 +256,10 @@ class ChangeListView(urwid.WidgetWrap):
|
|||||||
self.title = u'Unreviewed changes in %s' % self.query_desc
|
self.title = u'Unreviewed changes in %s' % self.query_desc
|
||||||
else:
|
else:
|
||||||
self.title = u'All changes in %s' % self.query_desc
|
self.title = u'All changes in %s' % self.query_desc
|
||||||
|
self.short_title = self.query_desc
|
||||||
|
if '/' in self.short_title and ' ' not in self.short_title:
|
||||||
|
i = self.short_title.rfind('/')
|
||||||
|
self.short_title = self.short_title[i+1:]
|
||||||
self.app.status.update(title=self.title)
|
self.app.status.update(title=self.title)
|
||||||
categories = set()
|
categories = set()
|
||||||
for change in change_list:
|
for change in change_list:
|
||||||
|
@ -315,10 +315,12 @@ class ProjectListView(urwid.WidgetWrap):
|
|||||||
def refresh(self):
|
def refresh(self):
|
||||||
if self.subscribed:
|
if self.subscribed:
|
||||||
self.title = u'Subscribed projects'
|
self.title = u'Subscribed projects'
|
||||||
|
self.short_title = self.title[:]
|
||||||
if self.unreviewed:
|
if self.unreviewed:
|
||||||
self.title += u' with unreviewed changes'
|
self.title += u' with unreviewed changes'
|
||||||
else:
|
else:
|
||||||
self.title = u'All projects'
|
self.title = u'All projects'
|
||||||
|
self.short_title = self.title[:]
|
||||||
self.app.status.update(title=self.title)
|
self.app.status.update(title=self.title)
|
||||||
with self.app.db.getSession() as session:
|
with self.app.db.getSession() as session:
|
||||||
i = 0
|
i = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user