Use css value for message input placeholder

This commit is contained in:
Philipp Hörist 2019-02-02 19:12:06 +01:00
parent dfc3749a4f
commit 15dc059bf3
3 changed files with 7 additions and 13 deletions

View File

@ -1 +1 @@
.gajim-incoming-nickname { color: rgb(164, 0, 0) } .gajim-outgoing-nickname { color: rgb(52, 101, 164) } .gajim-outgoing-message-text { color: rgb(85, 87, 83) } .gajim-status-message { color: rgb(78, 154, 6) } .gajim-url { color: rgb(32, 74, 135) } .gajim-highlight-message { color: rgb(255, 128, 128) } .gajim-restored-message { color: rgb(85, 87, 83) } .gajim-roster-disconnected { background: rgb(171 ,97 ,97) } .gajim-roster-connected { background: rgb(173, 195, 198) } .gajim-state-composing { color: rgb(0, 139, 0) } .gajim-state-inactive { color: rgb(158, 158, 158) } .gajim-state-gone { color: rgb(128, 128, 128) } .gajim-state-paused { color: rgb(0, 0, 205) }
.gajim-incoming-nickname { color: rgb(164, 0, 0) } .gajim-outgoing-nickname { color: rgb(52, 101, 164) } .gajim-outgoing-message-text { color: rgb(85, 87, 83) } .gajim-status-message { color: rgb(78, 154, 6) } .gajim-url { color: rgb(32, 74, 135) } .gajim-highlight-message { color: rgb(255, 128, 128) } .gajim-restored-message { color: rgb(85, 87, 83) } .gajim-roster-disconnected { background: rgb(171 ,97 ,97) } .gajim-roster-connected { background: rgb(173, 195, 198) } .gajim-state-composing { color: rgb(0, 139, 0) } .gajim-state-inactive { color: rgb(158, 158, 158) } .gajim-state-gone { color: rgb(128, 128, 128) } .gajim-state-paused { color: rgb(0, 0, 205) } .gajim-message-placeholder { color: rgb(195, 195, 192) }

View File

@ -54,14 +54,6 @@ if os.name == 'nt':
log = logging.getLogger('gajim.gtkgui_helpers')
class Color:
BLACK = Gdk.RGBA(red=0, green=0, blue=0, alpha=1)
GREEN = Gdk.RGBA(red=115/255, green=210/255, blue=22/255, alpha=1)
RED = Gdk.RGBA(red=204/255, green=0, blue=0, alpha=1)
GREY = Gdk.RGBA(red=195/255, green=195/255, blue=192/255, alpha=1)
ORANGE = Gdk.RGBA(red=245/255, green=121/255, blue=0/255, alpha=1)
def get_pixbuf_from_data(file_data):
"""
Get image data and returns GdkPixbuf.Pixbuf

View File

@ -24,10 +24,9 @@ from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Pango
from gajim import gtkgui_helpers
from gajim.common import app
from gajim.common.i18n import _
from gajim.common.const import StyleAttr
from gajim.gtk.util import scroll_to_end
@ -76,9 +75,12 @@ class MessageTextView(Gtk.TextView):
self.color_tags = []
self.fonts_tags = []
self.other_tags = {}
color = app.css_config.get_value(
'.gajim-message-placeholder', StyleAttr.COLOR)
self.placeholder_tag = buffer_.create_tag('placeholder')
self.placeholder_tag.set_property('foreground_rgba',
gtkgui_helpers.Color.GREY)
self.placeholder_tag.set_property('foreground', color)
self.other_tags['bold'] = buffer_.create_tag('bold')
self.other_tags['bold'].set_property('weight', Pango.Weight.BOLD)
self.begin_tags['bold'] = '<strong>'