Commit 4c599efb authored by Sergio Costas's avatar Sergio Costas

Added support for configurable and expandible color schemes

parent ebfb39e2
......@@ -57,6 +57,7 @@ if ( NOT WHERE_GRESOURCE )
endif()
add_subdirectory(po)
add_subdirectory(data/local)
add_subdirectory(terminus_gnome_shell)
add_subdirectory(data)
add_subdirectory(src/vapidir)
......
This diff is collapsed.
name: Black on light yellow
text_fg: #000000
text_bg: #FFFFDD
name: Black on white
text_fg: #000000
text_bg: #FFFFFF
name: Gray on black
text_fg: #C0C0C0
text_bg: #000000
name: Green on black
text_fg: #0FF77F
text_bg: #000000
name: Orange on black
text_fg: #FECE12
text_bg: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
palette: #000000
name: Prueba de paleta
text_fg: #000000
text_bg: #C0C0C0
name: White on black
text_fg: #FFFFFF
text_bg: #000000
......@@ -25,6 +25,36 @@
<default>"#000000"</default>
<summary>Background color</summary>
<description>The default color used for the terminal background</description>
</key>
<key type="s" name="bold-color">
<default>""</default>
<summary>Bold color</summary>
<description>The default color used for the terminal bold letters. An empty string means "use the default color".</description>
</key>
<key type="s" name="cursor-fg-color">
<default>""</default>
<summary>Cursor foreground color</summary>
<description>The default color used for the terminal cursor. An empty string means "use the default color".</description>
</key>
<key type="s" name="cursor-bg-color">
<default>""</default>
<summary>Cursor background color</summary>
<description>The default color used for the terminal cursor. An empty string means "use the default color".</description>
</key>
<key type="s" name="highlight-fg-color">
<default>""</default>
<summary>Highlight foreground color</summary>
<description>The default color used for the terminal highlighted letters. An empty string means "use the default color".</description>
</key>
<key type="s" name="highlight-bg-color">
<default>""</default>
<summary>Highlight background color</summary>
<description>The default color used for the terminal highlighted letters. An empty string means "use the default color".</description>
</key>
<key type="as" name="color-palete">
<default><![CDATA[['#000000','#AA0000','#00AA00','#AA5500','#0000AA','#AA00AA','#00AAAA','#AAAAAA','#555555','#FF5555','#55FF55','#FFFF55','#5555FF','#FF55FF','#55FFFF','#FFFFFF']]]></default>
<summary>Highlight background color</summary>
<description>The default color used for the terminal highlighted letters. An empty string means "use the default color".</description>
</key>
<key type="u" name="scroll-lines">
<default>500</default>
......
......@@ -4,7 +4,6 @@ rm -rf install
mkdir -p install
cd install
GTK_VERSION=`pkg-config --modversion gtk+-3.0`
GTK_MINVERSION="3.22"
echo $GTK_VERSION
if [ "$GTK_VERSION" \< "3.22" ];
then
......
......@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-17 23:36+0200\n"
"PO-Revision-Date: 2016-08-24 19:46+0200\n"
"PO-Revision-Date: 2016-12-22 01:55+0100\n"
"Last-Translator: Sergio Costas <rastersoft@gmail.com>\n"
"Language-Team: Español; Castellano <rastersoft@gmail.com>\n"
"Language: \n"
......@@ -33,7 +33,7 @@ msgstr "Negro sobre blanco"
#: src/settings.vala:72
msgid "Gray on black"
msgstr "Gris sobre blanco"
msgstr "Gris sobre negro"
#: src/settings.vala:73
msgid "Green on black"
......
......@@ -28,14 +28,11 @@ namespace Terminus {
class Base : Gtk.Notebook {
public static Terminus.Properties window_properties;
public signal void ended();
public signal void new_window();
public Base() {
Terminus.Base.window_properties = new Terminus.Properties();
this.page_added.connect(this.check_pages);
this.page_removed.connect(this.check_pages);
this.new_terminal_tab();
......
This diff is collapsed.
......@@ -181,8 +181,8 @@ namespace Terminus {
item = new Gtk.MenuItem.with_label(_("Preferences"));
item.activate.connect( () => {
Terminus.Base.window_properties.show_all();
Terminus.Base.window_properties.present();
Terminus.main_root.window_properties.show_all();
Terminus.main_root.window_properties.present();
});
this.menu.add(item);
......@@ -195,15 +195,11 @@ namespace Terminus {
this.menu.add(item);
this.menu.show_all();
this.show_all();
this.vte_terminal.button_press_event.connect(this.button_event);
this.vte_terminal.events = Gdk.EventMask.BUTTON_PRESS_MASK;
// Set all the properties
settings_changed("infinite-scroll");
settings_changed("fg-color");
settings_changed("bg-color");
settings_changed("use-system-font");
this.new_tab_key = new Gdk.Event(Gdk.EventType.KEY_RELEASE).key;
this.new_window_key = new Gdk.Event(Gdk.EventType.KEY_RELEASE).key;
this.next_tab_key = new Gdk.Event(Gdk.EventType.KEY_RELEASE).key;
......@@ -218,8 +214,19 @@ namespace Terminus {
Terminus.keybind_settings.changed.connect(this.keybind_settings_changed);
this.vte_terminal.key_press_event.connect(this.on_key_press);
this.show_all();
this.update_title();
// Set all the properties
settings_changed("infinite-scroll");
settings_changed("color-palete");
settings_changed("fg-color");
settings_changed("bg-color");
settings_changed("use-system-font");
settings_changed("bold-color");
settings_changed("highlight-fg-color");
settings_changed("highlight-bg-color");
settings_changed("cursor-fg-color");
settings_changed("cursor-bg-color");
}
public bool update_title_cb() {
......@@ -261,6 +268,20 @@ namespace Terminus {
public void settings_changed(string key) {
Gdk.RGBA? color = null;
string color_string;
if (key.has_suffix("-color")) {
color_string = Terminus.settings.get_string(key);
if (color_string != "") {
color = Gdk.RGBA();
if (false == color.parse(color_string)) {
color = null;
}
}
} else {
color_string = "";
}
switch(key) {
case "infinite-scroll":
case "scroll-lines":
......@@ -272,15 +293,43 @@ namespace Terminus {
this.vte_terminal.scrollback_lines = lines;
break;
case "fg-color":
var color = Gdk.RGBA();
color.parse(Terminus.settings.get_string("fg-color"));
this.vte_terminal.set_color_foreground(color);
break;
case "bg-color":
var color = Gdk.RGBA();
color.parse(Terminus.settings.get_string("bg-color"));
this.vte_terminal.set_color_background(color);
break;
case "bold-color":
this.vte_terminal.set_color_bold(color);
break;
case "cursor-fg-color":
this.vte_terminal.set_color_cursor_foreground(color);
break;
case "cursor-bg-color":
this.vte_terminal.set_color_cursor(color);
break;
case "highlight-fg-color":
this.vte_terminal.set_color_highlight_foreground(color);
break;
case "highlight-bg-color":
this.vte_terminal.set_color_highlight(color);
break;
case "color-palete":
if (Terminus.check_palette()) {
return;
}
string[] palette_string = Terminus.settings.get_strv("color-palete");
Gdk.RGBA[] palette = {};
foreach(var color_string2 in palette_string) {
var tmpcolor = Gdk.RGBA();
tmpcolor.parse(color_string2);
palette += tmpcolor;
}
var fgcolor = Gdk.RGBA();
fgcolor.parse(Terminus.settings.get_string("fg-color"));
var bgcolor = Gdk.RGBA();
bgcolor.parse(Terminus.settings.get_string("bg-color"));
this.vte_terminal.set_colors(fgcolor,bgcolor,palette);
break;
case "use-system-font":
case "terminal-font":
var system_font = Terminus.settings.get_boolean("use-system-font");
......@@ -296,7 +345,6 @@ namespace Terminus {
default:
break;
}
}
public bool on_key_press(Gdk.EventKey event) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment