Add icons for dark theme

This commit is contained in:
daleclack 2024-02-19 22:30:53 +08:00
parent f3a7f151b1
commit bfde3b616e
6 changed files with 83 additions and 0 deletions

View File

@ -114,9 +114,13 @@ set(RESOURCE_LIST
icons/scalable/status/vlc_whitesur.svg
icons/scalable/status/my_trash.svg
icons/scalable/status/circle.svg
icons/scalable/status/circle-dark.svg
icons/scalable/status/freehand.svg
icons/scalable/status/freehand-dark.svg
icons/scalable/status/line.svg
icons/scalable/status/line-dark.svg
icons/scalable/status/rectangle.svg
icons/scalable/status/rectangle-dark.svg
icons/scalable/status/calcapp.svg
icons/scalable/status/calcapp_running.svg
icons/scalable/status/mines_app.svg

View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#dedede;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M8 2A6 6 0 0 0 2 8 6 6 0 0 0 8 14 6 6 0 0 0 14 8 6 6 0 0 0 8 2M8 3A5 5 0 0 1 13 8 5 5 0 0 1 8 13 5 5 0 0 1 3 8 5 5 0 0 1 8 3"
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#dedede;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 9.15625 2 L 2 9.125 L 2 12 C 3.075 12.019 4.84375 12 4.84375 12 L 12 4.84375 L 9.15625 2 z M 8.4375 4.15625 L 9.84375 5.5625 L 6.9980469 8.4375 L 5.5605469 6.9980469 L 8.4375 4.15625 z M 4.84375 7.71875 L 6.28125 9.125 L 5.5625 9.84375 L 4.15625 8.4375 L 4.84375 7.71875 z M 12.123047 9 C 11.927047 9.001 11.392547 9.0455 10.560547 9.5625 C 10.300547 9.7245 10.107547 9.9089531 9.8105469 10.126953 C 9.6525469 10.242953 9.0850469 10.620953 8.8730469 10.751953 C 8.2540469 11.134953 8.0320469 11.231953 7.4980469 11.501953 C 6.9810469 11.762953 6.4395469 12.000453 6.0605469 12.189453 C 4.4685469 12.984453 1.9960937 13.001953 1.9960938 13.001953 L 1.9960938 14.001953 C 1.9960938 14.001953 4.4935469 14.033953 6.3105469 13.126953 C 6.5515469 13.006953 6.9790469 12.808953 7.3730469 12.626953 C 7.3730469 12.626953 8.4920469 12.034203 8.4980469 12.033203 C 8.6940469 11.924203 8.8592969 11.841203 9.1542969 11.658203 C 9.3822969 11.517203 9.9292969 11.166953 10.154297 11.001953 C 10.484297 10.758953 10.697047 10.579703 10.873047 10.470703 C 11.258047 10.168703 11.693047 9.9889531 12.123047 10.001953 C 12.089047 10.001953 12.253297 10.011703 12.404297 10.095703 C 12.555297 10.179703 12.714797 10.329703 12.841797 10.470703 C 13.086797 10.802703 13.198047 11.055953 13.248047 11.501953 C 13.212047 12.808953 11.968047 13.006953 10.998047 13.001953 L 10.998047 14.001953 C 12.977047 14.090953 13.998047 13.167703 13.998047 11.470703 C 13.994047 11.182703 13.947797 10.945953 13.841797 10.626953 C 13.735797 10.307953 13.575797 9.9514531 13.341797 9.6894531 C 12.980797 9.2664531 12.799047 9.0809531 12.123047 9.0019531 L 12.123047 9 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#dedede;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 11 2 L 11 4.3125 L 4.3125 11.001953 L 2.0019531 11.001953 L 2.0019531 14.001953 L 5.0019531 14.001953 L 5.0019531 11.6875 L 11.6875 5 L 14 5 L 14 2 L 11 2 z M 12 3 L 13 3 L 13 4 L 12 4 L 12 3 z M 3 12 L 4 12 L 4 13 L 3 13 L 3 12 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 569 B

View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#dedede;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="m2 2v12h12v-12zm1 1h10v10h-10z"
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 366 B

View File

@ -1,4 +1,5 @@
#include "DrawApp.h"
#include "MyFinder.h"
struct _DrawApp
{
@ -130,6 +131,19 @@ static void drag_end(GtkGestureDrag *gesture,
draw_brush(app, (app->start_x) + x, (app->start_y) + y, FALSE);
}
static GtkWidget *my_toggle_button_new_from_icon_name(DrawApp *self, const char *icon_name)
{
char icon_name1[NAME_MAX + 1];
GtkWidget *toggle_button = gtk_toggle_button_new();
strncpy(icon_name1, icon_name, NAME_MAX);
if (get_dark_mode(self))
{
strncat(icon_name1, "-dark", 5);
}
gtk_button_set_icon_name(GTK_BUTTON(toggle_button), icon_name1);
return toggle_button;
}
static void draw_app_init(DrawApp *self)
{
// Initalize window
@ -142,6 +156,15 @@ static void draw_app_init(DrawApp *self)
self->main_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
self->btn_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
// Add buttons for left box
self->btn_free = my_toggle_button_new_from_icon_name(self, "freehand");
self->btn_circle = my_toggle_button_new_from_icon_name(self, "circle");
gtk_toggle_button_set_group(GTK_TOGGLE_BUTTON(self->btn_circle), GTK_TOGGLE_BUTTON(self->btn_free));
self->btn_line = my_toggle_button_new_from_icon_name(self, "line");
gtk_toggle_button_set_group(GTK_TOGGLE_BUTTON(self->btn_line), GTK_TOGGLE_BUTTON(self->btn_free));
self->btn_rectangle = my_toggle_button_new_from_icon_name(self, "rectangle");
gtk_toggle_button_set_group(GTK_TOGGLE_BUTTON(self->btn_rectangle), GTK_TOGGLE_BUTTON(self->btn_free));
// Create Drawing Area
self->draw_area = gtk_drawing_area_new();
gtk_widget_set_size_request(self->draw_area, 640, 480);
@ -159,6 +182,10 @@ static void draw_app_init(DrawApp *self)
g_signal_connect(self->drag, "drag-end", G_CALLBACK(drag_end), self);
// Add widget to the window
gtk_box_append(GTK_BOX(self->left_box), self->btn_free);
gtk_box_append(GTK_BOX(self->left_box), self->btn_circle);
gtk_box_append(GTK_BOX(self->left_box), self->btn_line);
gtk_box_append(GTK_BOX(self->left_box), self->btn_rectangle);
gtk_box_append(GTK_BOX(self->main_box), self->left_box);
gtk_box_append(GTK_BOX(self->main_box), self->draw_area);
gtk_box_append(GTK_BOX(self->main_box), self->btn_box);