Skip to content

Commit

Permalink
gtksourceview: Provide a better default style
Browse files Browse the repository at this point in the history
Tango has two issues when the GTK theme is dark:

- Starting with Mint 22, its line numbers column is hardcoded to grey
and looks way too bright.
- Comments are unreadable on a dark bg.

Fixes linuxmint/mint22-beta#60
Helps with linuxmint/mint22-beta#5
  • Loading branch information
clefebvre committed Jul 4, 2024
1 parent 9bd60fb commit be3046d
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 1 deletion.
5 changes: 5 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ install_data(
'xed.1',
install_dir : join_paths(get_option('prefix'), get_option('mandir'), 'man1')
)

install_data(
'xed.xml',
install_dir: join_paths(datadir, 'gtksourceview-4', 'styles')
)
2 changes: 1 addition & 1 deletion data/org.x.editor.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</key>

<key name="scheme" type="s">
<default>'tango'</default>
<default>'xed'</default>
<summary>Style Scheme</summary>
<description>The ID of a GtkSourceView Style Scheme used to color the text.</description>
</key>
Expand Down
123 changes: 123 additions & 0 deletions data/xed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="xed" _name="Xed" version="1.0">
<author>Xed Team</author>
<_description>The default color scheme.</_description>

<!-- Tango Palette -->
<color name="butter1" value="#fce94f"/>
<color name="butter2" value="#edd400"/>
<color name="butter3" value="#c4a000"/>
<color name="chameleon1" value="#8ae234"/>
<color name="chameleon2" value="#73d216"/>
<color name="chameleon3" value="#4e9a06"/>
<color name="orange1" value="#fcaf3e"/>
<color name="orange2" value="#f57900"/>
<color name="orange3" value="#ce5c00"/>
<color name="skyblue1" value="#729fcf"/>
<color name="skyblue2" value="#3465a4"/>
<color name="skyblue3" value="#204a87"/>
<color name="plum1" value="#ad7fa8"/>
<color name="plum2" value="#75507b"/>
<color name="plum3" value="#5c3566"/>
<color name="chocolate1" value="#e9b96e"/>
<color name="chocolate2" value="#c17d11"/>
<color name="chocolate3" value="#8f5902"/>
<color name="scarletred1" value="#ef2929"/>
<color name="scarletred2" value="#cc0000"/>
<color name="scarletred3" value="#a40000"/>
<color name="aluminium1" value="#eeeeec"/>
<color name="aluminium2" value="#d3d7cf"/>
<color name="aluminium3" value="#babdb6"/>
<color name="aluminium4" value="#888a85"/>
<color name="aluminium5" value="#555753"/>
<color name="aluminium6" value="#2e3436"/>

<!-- Global Settings -->
<style name="line-numbers" background="#rgba(18,20,21,0.005)"/>
<style name="current-line" background="aluminium1"/>
<style name="current-line-number" background="aluminium1"/>
<style name="draw-spaces" foreground="aluminium3"/>
<style name="background-pattern" background="#f3f3f3"/>

<!-- Bracket Matching -->
<style name="bracket-match" foreground="aluminium1" background="aluminium3"/>
<style name="bracket-mismatch" foreground="aluminium1" background="scarletred3"/>

<!-- Right Margin -->
<style name="right-margin" foreground="aluminium6" background="aluminium6"/>

<!-- Search Matching -->
<style name="search-match" background="butter1"/>

<!-- Comments -->
<style name="def:comment" foreground="aluminium4"/>
<style name="def:shebang" foreground="skyblue3" bold="true"/>
<style name="def:doc-comment-element" italic="true"/>

<!-- Constants -->
<style name="def:constant" foreground="plum1"/>
<style name="def:special-char" foreground="plum3"/>

<!-- Identifiers -->
<style name="def:identifier" foreground="skyblue2"/>

<!-- Statements -->
<style name="def:statement" foreground="scarletred3" bold="true"/>

<!-- Types -->
<style name="def:type" foreground="chameleon3" bold="true"/>

<!-- Markup -->
<style name="def:emphasis" italic="true"/>
<style name="def:strong-emphasis" foreground="scarletred3" bold="true"/>
<style name="def:inline-code" foreground="skyblue2"/>
<style name="def:insertion" underline="single"/>
<style name="def:deletion" strikethrough="true"/>
<style name="def:link-text" foreground="skyblue3"/>
<style name="def:link-symbol" foreground="skyblue3" bold="true"/>
<style name="def:link-destination" italic="true" underline="single"/>
<style name="def:heading" foreground="chameleon3" bold="true"/>
<style name="def:thematic-break" foreground="chameleon3" bold="true"/>
<style name="def:preformatted-section" foreground="skyblue2"/>
<style name="def:list-marker" foreground="scarletred3" bold="true"/>

<!-- Others -->
<style name="def:preprocessor" foreground="chocolate3"/>
<style name="def:error" background="scarletred2" bold="true"/>
<style name="def:warning" background="plum1"/>
<style name="def:note" background="orange1" bold="true"/>
<style name="def:net-address" italic="true" underline="single"/>

<!-- Heading styles, uncomment to enable -->
<!--
<style name="def:heading0" scale="5.0"/>
<style name="def:heading1" scale="2.5"/>
<style name="def:heading2" scale="2.0"/>
<style name="def:heading3" scale="1.7"/>
<style name="def:heading4" scale="1.5"/>
<style name="def:heading5" scale="1.3"/>
<style name="def:heading6" scale="1.2"/>
-->

<!-- Language specific -->
<style name="diff:added-line" foreground="chameleon3"/>
<style name="diff:removed-line" foreground="plum3"/>
<style name="diff:changed-line" use-style="def:preprocessor"/>
<style name="diff:diff-file" use-style="def:type"/>
<style name="diff:location" use-style="def:statement"/>
<style name="diff:special-case" use-style="def:constant"/>

<style name="xml:tags" foreground="chameleon3"/>
<style name="xml:namespace" bold="true"/>

<style name="js:built-in-constructor" foreground="chameleon3"/>

<style name="latex:display-math" foreground="plum3"/>
<style name="latex:command" foreground="chameleon3" bold="true"/>
<style name="latex:include" use-style="def:preprocessor"/>
<style name="latex:special-char" use-style="def:constant"/>

<style name="sh:variable" foreground="plum3"/>
<style name="sh:variable-definition" foreground="chameleon3"/>

</style-scheme>
1 change: 1 addition & 0 deletions debian/xed-common.install
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ usr/share/glib-2.0
usr/share/help
usr/share/locale
usr/share/xed/icons
usr/share/gtksourceview*

0 comments on commit be3046d

Please sign in to comment.