mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-30 09:10:19 +00:00
Compare commits
4 Commits
mutli-line
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
069652a5f1 | ||
|
|
ab1e25bfb1 | ||
|
|
862aa0ede5 | ||
| bb36651548 |
@@ -41,7 +41,7 @@ static zoitechat_plugin *ph;
|
||||
static char name[] = "Sysinfo";
|
||||
static char desc[] = "Display info about your hardware and OS";
|
||||
static char version[] = "1.0";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|DISK|GPU|CHIPSET|SOUND|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|STORAGE|GPU|CHIPSET|SOUND|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -68,7 +68,7 @@ static hwinfo hwinfos[] = {
|
||||
{"os", "OS", sysinfo_backend_get_os},
|
||||
{"cpu", "CPU", sysinfo_backend_get_cpu},
|
||||
{"memory", "Memory", sysinfo_backend_get_memory},
|
||||
{"storage", "Storage", sysinfo_backend_get_disk},
|
||||
{"storage", "Storage", sysinfo_backend_get_disk, TRUE},
|
||||
{"gpu", "GPU", sysinfo_backend_get_gpu},
|
||||
{"chipset", "CHIPSET", sysinfo_backend_get_chipset, TRUE},
|
||||
{"sound", "Sound", sysinfo_backend_get_sound, TRUE},
|
||||
|
||||
@@ -415,6 +415,24 @@ theme_manager_is_kde_wayland (void)
|
||||
return is_kde;
|
||||
}
|
||||
|
||||
static gint
|
||||
theme_manager_get_system_headerbar_height (void)
|
||||
{
|
||||
GtkWidget *probe;
|
||||
gint minimum;
|
||||
gint natural;
|
||||
|
||||
probe = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (probe), TRUE);
|
||||
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (probe), "menu:minimize,maximize,close");
|
||||
gtk_widget_show (probe);
|
||||
gtk_widget_get_preferred_height (probe, &minimum, &natural);
|
||||
gtk_widget_destroy (probe);
|
||||
if (natural > 0)
|
||||
return natural;
|
||||
return minimum;
|
||||
}
|
||||
|
||||
static void
|
||||
theme_manager_apply_wayland_kde_csd (GtkWidget *window)
|
||||
{
|
||||
@@ -442,10 +460,16 @@ theme_manager_apply_wayland_kde_csd (GtkWidget *window)
|
||||
headerbar = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
|
||||
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (headerbar), "menu:minimize,maximize,close");
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.svg", 32, 32, TRUE, NULL);
|
||||
g_object_set (G_OBJECT (headerbar), "spacing", 0, NULL);
|
||||
gtk_widget_set_size_request (headerbar, -1, theme_manager_get_system_headerbar_height ());
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.svg", 24, 24, TRUE, NULL);
|
||||
if (!icon_pixbuf)
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.png", 32, 32, TRUE, NULL);
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.png", 24, 24, TRUE, NULL);
|
||||
icon_image = icon_pixbuf ? gtk_image_new_from_pixbuf (icon_pixbuf) : gtk_image_new_from_resource ("/icons/zoitechat.png");
|
||||
gtk_widget_set_margin_start (icon_image, 0);
|
||||
gtk_widget_set_margin_end (icon_image, 0);
|
||||
gtk_widget_set_margin_top (icon_image, 0);
|
||||
gtk_widget_set_margin_bottom (icon_image, 0);
|
||||
if (icon_pixbuf)
|
||||
g_object_unref (icon_pixbuf);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), icon_image);
|
||||
|
||||
Reference in New Issue
Block a user