Skip to content

Commit

Permalink
sourceview: Simplify current line highlighting with an alpha style
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiw committed Aug 4, 2018
1 parent 4d2a74d commit 42e704a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/styles/meld-base.xml
Expand Up @@ -9,7 +9,7 @@
<style name="meld:delete" background="#ffffff" foreground="#880000" line-background="#cccccc"/>
<style name="meld:error" background="#fce94f" foreground="#faad3d" line-background="#fade0a"/>
<style name="meld:inline" background="#8ac2ff"/>
<style name="meld:current-line-highlight" foreground="#333333" background="#ffff00"/>
<style name="meld:current-line-highlight" foreground="#333333" background="#rgba(255, 255, 0, 0.25)"/>
<style name="meld:unknown-text" foreground="#888888"/>
<style name="meld:syncpoint-outline" foreground="#555555"/>
<style name="meld:current-chunk-highlight" background="#rgba(255, 255, 255, 0.5)"/>
Expand Down
2 changes: 1 addition & 1 deletion data/styles/meld-dark.xml
Expand Up @@ -10,7 +10,7 @@
<style name="meld:delete" background="#ffffff" foreground="#a40000" line-background="#cccccc"/>
<style name="meld:error" background="#fce94f" foreground="#faad3d" line-background="#fdf8cd"/>
<style name="meld:inline" background="#24527e"/>
<style name="meld:current-line-highlight" foreground="#eeeeee" background="#111100"/>
<style name="meld:current-line-highlight" foreground="#eeeeee" background="#rgba(17, 17, 0, 0.25)"/>
<style name="meld:unknown-text" foreground="#aaaaaa"/>
<style name="meld:syncpoint-outline" foreground="#bbbbbb"/>
<style name="meld:current-chunk-highlight" background="#rgba(255, 255, 255, 0.06)"/>
Expand Down
5 changes: 1 addition & 4 deletions meld/sourceview.py
Expand Up @@ -272,12 +272,9 @@ def do_draw_layer(self, layer, context):
if self.props.highlight_current_line_local and self.is_focus():
it = textbuffer.get_iter_at_mark(textbuffer.get_insert())
ypos, line_height = self.get_line_yrange(it)
context.save()
context.rectangle(x, ypos, width, line_height)
context.clip()
context.set_source_rgba(*self.highlight_color)
context.paint_with_alpha(0.25)
context.restore()
context.fill()

# Draw syncpoint indicator lines
for syncpoint in self.syncpoints:
Expand Down

0 comments on commit 42e704a

Please sign in to comment.