Commit cee3b95e authored by Maximiliano's avatar Maximiliano 🥑 Committed by Zander Brown
Browse files

Use libadwaita & color scheme API

This allows to use a regular flat header bar and honor the system color
scheme. We also drop redundant css.

Fixes: #3
parent 0f86b041
Pipeline #323756 passed with stage
in 1 minute and 4 seconds
......@@ -17,6 +17,7 @@
*/
#include <glib/gi18n.h>
#include <adwaita.h>
#include "config.h"
#include "window.h"
......@@ -38,34 +39,19 @@ activate (GtkApplication *app)
}
static void
startup (GtkApplication *app)
{
g_autoptr (GtkCssProvider) styles = NULL;
styles = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (styles, "/org/gnome/design/Typography/gtk/style.css");
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (styles),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
int
main (int argc,
char *argv[])
{
g_autoptr (GtkApplication) app = NULL;
g_autoptr (AdwApplication) app = NULL;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
app = gtk_application_new ("org.gnome.design.Typography", G_APPLICATION_FLAGS_NONE);
app = adw_application_new ("org.gnome.design.Typography", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
return g_application_run (G_APPLICATION (app), argc, argv);
}
......
......@@ -5,6 +5,7 @@ sources = [
deps = [
dependency('gtk4'),
dependency('libadwaita-1'),
]
gnome = import('gnome')
......
......@@ -2,14 +2,6 @@
background-color: alpha(@theme_bg_color, 0.96);
}
.typography-window:not(.solid-csd):not(.fullscreen):not(.tiled):not(.tiled-top):not(.tiled-bottom):not(.tiled-left):not(.tiled-right):not(.maximized) {
border-radius: 8px;
}
.typography-window.maximised {
border-radius: 0;
}
.typography {
margin: 0 12px 12px 12px;
}
......@@ -17,16 +9,3 @@
.typography-chars button {
font-weight: bold;
}
.typography-styles button:hover {
background: #deddda;
}
.typography-styles button:active {
background: #c0bfbc;
}
headerbar.flat {
background: none;
border: none;
}
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