Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions usr/lib/sticky/sticky.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
'purple': _("Purple"),
'teal': _("Teal"),
'orange': _("Orange"),
'magenta': _("Magenta")
'magenta': _("Magenta"),
'transparent':_("transparent")
}

COLOR_CODES = {
Expand All @@ -71,7 +72,8 @@
'purple': "#a553ff",
'teal': "#41ffed",
'orange': "#ffa939",
'magenta': "#ff7ff7"
'magenta': "#ff7ff7",
'transparent':"#ffffff00"
}

SHORTCUTS = {
Expand Down Expand Up @@ -227,6 +229,10 @@ def __init__(self, app, parent, info={}):
self.view.set_right_margin(10)
self.view.set_top_margin(10)
self.view.set_bottom_margin(10)
self.view.set_app_paintable(True)
self.view.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(0, 0, 0, 0))
self.view.get_style_context().add_class("note-textview")
self.view.override_background_color(Gtk.StateFlags.NORMAL, None)
self.view.connect('populate-popup', lambda w, p: self.add_context_menu_items(p))
self.view.connect('key-press-event', self.on_key_press)
self.view_style_manager = XApp.StyleManager(widget=self.view)
Expand Down Expand Up @@ -529,10 +535,18 @@ def set_color(self, menu, color):
if color == self.color:
return

self.get_style_context().remove_class(self.color)
self.get_style_context().add_class(color)
self.color = color
ctx = self.get_style_context()
ctx.remove_class(self.color)
ctx.add_class(color)

tv_ctx = self.view.get_style_context()

if color == "transparent":
tv_ctx.add_class("note-transparent")
else:
tv_ctx.remove_class("note-transparent")

self.color = color
self.emit('update')

def set_font(self, *args):
Expand Down
21 changes: 21 additions & 0 deletions usr/share/sticky/sticky.css
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,24 @@ button.magenta {
color: #303030;
box-shadow: 1px 1px 2px;
}

.note-transparent,
.note-transparent textview,
.note-transparent text {
background-color: transparent;
background-image: none;
}

#sticky-note.transparent textview text,
#sticky-note.transparent textview,
#sticky-note.transparent {
background-color: transparent;
background-image: none;
}

#sticky-note.transparent textview text {
background-color: rgba(0, 0, 0, 0.4);
color: white;
caret-color: white;
border-radius: 6px;
}