aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h2
-rw-r--r--main.c20
2 files changed, 15 insertions, 7 deletions
diff --git a/config.h b/config.h
index 578fa6c..7211256 100644
--- a/config.h
+++ b/config.h
@@ -33,3 +33,5 @@ static const int foreground_bold = 0xd8dee9;
static const int background = 0x171a20;
static const int highlight = 0x4c566a;
+
+static const double font_scale = 1.1;
diff --git a/main.c b/main.c
index 06591b2..9facc94 100644
--- a/main.c
+++ b/main.c
@@ -15,6 +15,7 @@ static void child_ready(VteTerminal*, GPid, GError*, gpointer);
int main(int argc, char *argv[]) {
GtkWidget *window, *terminal;
+ VteTerminal *vTerminal;
/* Initialise GTK, the window and the terminal */
gtk_init(&argc, &argv);
@@ -22,8 +23,10 @@ int main(int argc, char *argv[]) {
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "mterm");
+ vTerminal = VTE_TERMINAL(terminal);
+
/* Set colors */
- vte_terminal_set_colors(VTE_TERMINAL(terminal),
+ vte_terminal_set_colors(vTerminal,
&CLR_GDK(foreground, 0),
&CLR_GDK(background, transparency),
(const GdkRGBA[]){
@@ -46,17 +49,18 @@ int main(int argc, char *argv[]) {
}, 16);
/* More settings */
- vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), max_lines);
- vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), scroll_on_output);
- vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), scroll_on_keystroke);
- vte_terminal_set_mouse_autohide(VTE_TERMINAL(terminal), mouse_autohide);
- vte_terminal_set_allow_hyperlink(VTE_TERMINAL(terminal), TRUE);
+ vte_terminal_set_scrollback_lines(vTerminal, max_lines);
+ vte_terminal_set_scroll_on_output(vTerminal, scroll_on_output);
+ vte_terminal_set_scroll_on_keystroke(vTerminal, scroll_on_keystroke);
+ vte_terminal_set_mouse_autohide(vTerminal, mouse_autohide);
+ vte_terminal_set_allow_hyperlink(vTerminal, TRUE);
+ vte_terminal_set_font_scale(vTerminal, font_scale);
/* Start a new shell */
gchar **envp = g_get_environ();
gchar **command = (gchar *[]){g_strdup(g_environ_getenv(envp, "SHELL")), NULL };
g_strfreev(envp);
- vte_terminal_spawn_async(VTE_TERMINAL(terminal),
+ vte_terminal_spawn_async(vTerminal,
VTE_PTY_DEFAULT,
NULL, /* working directory */
command, /* command */
@@ -73,6 +77,8 @@ int main(int argc, char *argv[]) {
g_signal_connect(window, "delete-event", gtk_main_quit, NULL);
g_signal_connect(terminal, "child-exited", gtk_main_quit, NULL);
+ gtk_widget_set_visual(window, gdk_screen_get_rgba_visual(gtk_widget_get_screen(window)));
+
/* Put widgets together and run the main loop */
gtk_container_add(GTK_CONTAINER(window), terminal);
gtk_widget_show_all(window);