mirror of
https://github.com/HerrCraziDev/tiny-kyoukai.git
synced 2025-12-13 09:36:16 +01:00
Added style as resource, deps issue on ubuntu/debian
This commit is contained in:
11
main.c
11
main.c
@@ -225,7 +225,10 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
|||||||
kyou = gtk_picture_new_for_resource( KYOU_IMAGE_RESOURCE );
|
kyou = gtk_picture_new_for_resource( KYOU_IMAGE_RESOURCE );
|
||||||
#endif
|
#endif
|
||||||
gtk_picture_set_can_shrink(GTK_PICTURE(kyou), FALSE);
|
gtk_picture_set_can_shrink(GTK_PICTURE(kyou), FALSE);
|
||||||
gtk_picture_set_content_fit(GTK_PICTURE(kyou), GTK_CONTENT_FIT_CONTAIN);
|
if ( gtk_get_major_version() != 4 && gtk_get_minor_version() <= 8 )
|
||||||
|
gtk_picture_set_keep_aspect_ratio( GTK_PICTURE(kyou), true );
|
||||||
|
else
|
||||||
|
gtk_picture_set_content_fit(GTK_PICTURE(kyou), GTK_CONTENT_FIT_CONTAIN);
|
||||||
|
|
||||||
/* Setup event listeners */
|
/* Setup event listeners */
|
||||||
ev_key = gtk_event_controller_key_new();
|
ev_key = gtk_event_controller_key_new();
|
||||||
@@ -249,7 +252,11 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
|||||||
|
|
||||||
/* Make window background transparent */
|
/* Make window background transparent */
|
||||||
GtkCssProvider *provider = gtk_css_provider_new();
|
GtkCssProvider *provider = gtk_css_provider_new();
|
||||||
|
#ifndef KYOU_PORTABLE
|
||||||
gtk_css_provider_load_from_string(provider, "window {background: transparent;}");
|
gtk_css_provider_load_from_string(provider, "window {background: transparent;}");
|
||||||
|
#else
|
||||||
|
gtk_css_provider_load_from_resource(provider, KYOU_RESOURCES "/kyou.css");
|
||||||
|
#endif
|
||||||
gtk_style_context_add_provider_for_display(gdk_display_get_default(),GTK_STYLE_PROVIDER(provider),GTK_STYLE_PROVIDER_PRIORITY_USER);
|
gtk_style_context_add_provider_for_display(gdk_display_get_default(),GTK_STYLE_PROVIDER(provider),GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||||
|
|
||||||
/* Hide window frame and title bar */
|
/* Hide window frame and title bar */
|
||||||
@@ -297,4 +304,4 @@ int main(int argc, char **argv) {
|
|||||||
"\n\tLet blood boil over!\n" );
|
"\n\tLet blood boil over!\n" );
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
3
ressources/kyou.css
Normal file
3
ressources/kyou.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
window {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<gresources>
|
<gresources>
|
||||||
<gresource prefix="/dev/chenco/tiny-kyoukai">
|
<gresource prefix="/dev/chenco/tiny-kyoukai">
|
||||||
<file>kyoukai_peek.png</file>
|
<file>kyoukai_peek.png</file>
|
||||||
|
<file>kyou.css</file>
|
||||||
<file alias="icons/48x48/apps/tiny-kyoukai.png">hicolor/48x48/apps/tiny-kyoukai.png</file>
|
<file alias="icons/48x48/apps/tiny-kyoukai.png">hicolor/48x48/apps/tiny-kyoukai.png</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
</gresources>
|
</gresources>
|
||||||
Reference in New Issue
Block a user