2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
#include<gtk/gtk.h>
|
|
|
|
|
2017-12-25 22:17:08 +00:00
|
|
|
/*#define COLOR " #0f0;"*/
|
|
|
|
#define COLOR " red;"
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
static const char *css =
|
|
|
|
".one {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" box-shadow: -10px -20px 5px 40px" COLOR
|
|
|
|
"}"
|
|
|
|
".two {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" box-shadow: -10px -20px 0px 40px" COLOR
|
|
|
|
"}"
|
|
|
|
".three {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" border-radius: 0px;"
|
|
|
|
" box-shadow: 0px 0px 10px 20px" COLOR
|
|
|
|
"}"
|
|
|
|
".four {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
2017-12-25 22:17:08 +00:00
|
|
|
" min-height: 100px;"
|
2017-12-21 16:57:16 +00:00
|
|
|
" box-shadow: 10px 20px 5px 40px" COLOR
|
|
|
|
" border-radius: 30px; "
|
2017-12-25 22:17:08 +00:00
|
|
|
" margin-right: 50px;"
|
2017-12-21 16:57:16 +00:00
|
|
|
"}"
|
|
|
|
".five {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" border-radius: 30px; "
|
|
|
|
" box-shadow: 10px 20px 0px 40px" COLOR
|
|
|
|
"}"
|
2017-12-25 22:17:08 +00:00
|
|
|
/* This is the default CSD drop shadow from (current) Adwaita */
|
2017-12-21 16:57:16 +00:00
|
|
|
".b1 {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
2019-11-26 08:38:53 +00:00
|
|
|
" min-height: 100px;"
|
2017-12-25 22:17:08 +00:00
|
|
|
" border-radius: 7px 7px 0px 0px;"
|
2017-12-28 15:41:08 +00:00
|
|
|
" box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.5);"
|
2017-12-21 16:57:16 +00:00
|
|
|
"}"
|
2017-12-25 22:17:08 +00:00
|
|
|
#if 0
|
2017-12-21 16:57:16 +00:00
|
|
|
".b2 {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
2017-12-25 22:17:08 +00:00
|
|
|
" border-radius: 7px 7px 0 0;"
|
|
|
|
" box-shadow: 0 0 0 30px green;"
|
2017-12-21 16:57:16 +00:00
|
|
|
"}"
|
|
|
|
".b3 {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" border-right: 30px solid blue;"
|
|
|
|
" border-radius: 40px;"
|
|
|
|
"}"
|
|
|
|
".b4 {"
|
|
|
|
" all: unset;"
|
|
|
|
" min-width: 100px;"
|
|
|
|
" min-height:100px;"
|
|
|
|
" border-bottom: 30px solid blue;"
|
|
|
|
" border-radius: 40px;"
|
|
|
|
"}"
|
|
|
|
#endif
|
2017-12-25 22:17:08 +00:00
|
|
|
""
|
2017-12-21 16:57:16 +00:00
|
|
|
;
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
static void
|
|
|
|
quit_cb (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean *done = data;
|
|
|
|
|
|
|
|
*done = TRUE;
|
|
|
|
|
|
|
|
g_main_context_wakeup (NULL);
|
|
|
|
}
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *box;
|
|
|
|
GtkWidget *top;
|
|
|
|
GtkWidget *bottom;
|
|
|
|
GtkWidget *w;
|
|
|
|
GtkCssProvider *provider;
|
2020-02-10 03:24:47 +00:00
|
|
|
gboolean done = FALSE;
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
gtk_init ();
|
|
|
|
|
|
|
|
provider = gtk_css_provider_new ();
|
|
|
|
gtk_css_provider_load_from_data (provider, css, -1);
|
|
|
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
|
|
|
GTK_STYLE_PROVIDER (provider),
|
|
|
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
|
|
|
2020-02-14 19:55:36 +00:00
|
|
|
window = gtk_window_new ();
|
2019-11-26 08:38:53 +00:00
|
|
|
gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
|
2017-12-21 16:57:16 +00:00
|
|
|
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 120);
|
|
|
|
top = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 120);
|
|
|
|
bottom = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 120);
|
2020-02-26 01:57:20 +00:00
|
|
|
gtk_widget_set_margin_start (box, 120);
|
|
|
|
gtk_widget_set_margin_end (box, 120);
|
|
|
|
gtk_widget_set_margin_top (box, 120);
|
|
|
|
gtk_widget_set_margin_bottom (box, 120);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "one");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (top), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "two");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (top), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "three");
|
2017-12-28 15:41:08 +00:00
|
|
|
gtk_widget_set_opacity (w, 0.7);
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (top), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "four");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (top), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "five");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (top), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
/* Bottom */
|
2017-12-25 22:17:08 +00:00
|
|
|
w = gtk_button_new ();
|
|
|
|
gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
|
2020-04-10 16:08:16 +00:00
|
|
|
gtk_widget_add_css_class (w, "b1");
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (bottom), w);
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
/*w = gtk_button_new ();*/
|
|
|
|
/*gtk_widget_set_valign (w, GTK_ALIGN_CENTER);*/
|
2020-04-10 16:08:16 +00:00
|
|
|
/*gtk_widget_add_css_class (w, "b2");*/
|
2020-05-09 12:26:52 +00:00
|
|
|
/*gtk_box_append (GTK_BOX (bottom), w);*/
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
/*w = gtk_button_new ();*/
|
|
|
|
/*gtk_widget_set_valign (w, GTK_ALIGN_CENTER);*/
|
2020-04-10 16:08:16 +00:00
|
|
|
/*gtk_widget_add_css_class (w, "b3");*/
|
2020-05-09 12:26:52 +00:00
|
|
|
/*gtk_box_append (GTK_BOX (bottom), w);*/
|
2017-12-21 16:57:16 +00:00
|
|
|
|
|
|
|
/*w = gtk_button_new ();*/
|
|
|
|
/*gtk_widget_set_valign (w, GTK_ALIGN_CENTER);*/
|
2020-04-10 16:08:16 +00:00
|
|
|
/*gtk_widget_add_css_class (w, "b4");*/
|
2020-05-09 12:26:52 +00:00
|
|
|
/*gtk_box_append (GTK_BOX (bottom), w);*/
|
2017-12-21 16:57:16 +00:00
|
|
|
|
2020-05-09 12:26:52 +00:00
|
|
|
gtk_box_append (GTK_BOX (box), top);
|
|
|
|
gtk_box_append (GTK_BOX (box), bottom);
|
2020-05-02 21:26:54 +00:00
|
|
|
gtk_window_set_child (GTK_WINDOW (window), box);
|
2020-02-10 03:24:47 +00:00
|
|
|
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
|
2017-12-21 16:57:16 +00:00
|
|
|
gtk_widget_show (window);
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
while (!done)
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2017-12-21 16:57:16 +00:00
|
|
|
}
|