diff --git a/gertty/palette.py b/gertty/palette.py index 286ae39..7a4ab11 100644 --- a/gertty/palette.py +++ b/gertty/palette.py @@ -60,13 +60,16 @@ DEFAULT_PALETTE={ 'focused-revision-comments': ['default,standout', ''], 'focused-revision-drafts': ['dark red,standout', ''], 'change-message-name': ['yellow', ''], + 'change-message-own-name': ['light cyan', ''], 'change-message-header': ['brown', ''], + 'change-message-own-header': ['dark cyan', ''], 'change-message-draft': ['dark red', ''], 'revision-button': ['dark magenta', ''], 'focused-revision-button': ['light magenta', ''], 'lines-added': ['light green', ''], 'lines-removed': ['light red', ''], 'reviewer-name': ['yellow', ''], + 'reviewer-own-name': ['light cyan', ''], # project list 'unreviewed-project': ['white', ''], 'subscribed-project': ['default', ''], @@ -97,8 +100,11 @@ LIGHT_PALETTE = { 'change-data': ['dark blue,bold', ''], 'focused-change-data': ['dark blue,standout', ''], 'reviewer-name': ['brown', ''], + 'reviewer-own-name': ['dark blue,bold', ''], 'change-message-name': ['brown', ''], + 'change-message-own-name': ['dark blue,bold', ''], 'change-message-header': ['black', ''], + 'change-message-own-header': ['black,bold', ''], 'focused-link': ['dark blue,bold', ''], 'filename': ['dark cyan', ''], } diff --git a/gertty/view/change.py b/gertty/view/change.py index 48828ab..30e0876 100644 --- a/gertty/view/change.py +++ b/gertty/view/change.py @@ -347,9 +347,15 @@ class ChangeMessageBox(mywid.HyperText): if message.draft: lines.insert(0, '') lines.insert(0, 'Patch Set %s:' % (message.revision.number,)) - text = [('change-message-name', message.author_name), - ('change-message-header', ': '+lines.pop(0)), - ('change-message-header', + if message.author.username == self.app.config.username: + name_style = 'change-message-own-name' + header_style = 'change-message-own-header' + else: + name_style = 'change-message-name' + header_style = 'change-message-header' + text = [(name_style, message.author_name), + (header_style, ': '+lines.pop(0)), + (header_style, created.strftime(' (%Y-%m-%d %H:%M:%S%z)'))] if message.draft and not message.pending: text.append(('change-message-draft', ' (draft)')) @@ -588,7 +594,11 @@ class ChangeView(urwid.WidgetWrap): if not approvals: approvals = {} row = [] - row.append(urwid.Text(('reviewer-name', approval.reviewer.name))) + if approval.reviewer.username == self.app.config.username: + style = 'reviewer-own-name' + else: + style = 'reviewer-name' + row.append(urwid.Text((style, approval.reviewer.name))) for i, category in enumerate(categories): w = urwid.Text(u'', align=urwid.CENTER) approvals[category] = w