You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
JavaWidget: add css classes and default_stylesheet.css
This commit is contained in:
6
src/main-executable/atl.gresource.xml
Normal file
6
src/main-executable/atl.gresource.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/com/gitlab/android-translation-layer/android-translation-layer">
|
||||
<file alias="default-stylesheet.css">src/main-executable/css/default-stylesheet.css</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
31
src/main-executable/css/default-stylesheet.css
Normal file
31
src/main-executable/css/default-stylesheet.css
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Border Styling */
|
||||
.ATL-no-border {
|
||||
border: unset;
|
||||
}
|
||||
|
||||
/* Font styling */
|
||||
.ATL-font-bold > * {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ATL-font-italic > * {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Text styling */
|
||||
.ATL-text-uppercase > * {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.ATL-text-align-left > * {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ATL-text-align-center > * {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ATL-text-align-right > * {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -417,6 +417,11 @@ static void open(GtkApplication *app, GFile **files, gint nfiles, const gchar *h
|
||||
if (getenv("ATL_FORCE_FULLSCREEN"))
|
||||
gtk_window_fullscreen(GTK_WINDOW(window));
|
||||
|
||||
// Load default css stylesheet
|
||||
GtkCssProvider * cssProvider = gtk_css_provider_new();
|
||||
gtk_css_provider_load_from_resource(cssProvider, "/com/gitlab/android-translation-layer/android-translation-layer/default-stylesheet.css");
|
||||
gtk_style_context_add_provider_for_display(gdk_display_get_default(), GTK_STYLE_PROVIDER(cssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
prepare_main_looper(env);
|
||||
|
||||
// construct Application
|
||||
|
||||
Reference in New Issue
Block a user