Optimization for GUI LiveCD

This commit is contained in:
longpanda 2021-09-30 07:37:49 +08:00
parent 849eb7bf2c
commit 47797f0285
8 changed files with 24 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -202,8 +202,6 @@ void on_secure_boot_toggled(GtkMenuItem *menuItem, gpointer data)
{
g_secure_boot_support = 1 - g_secure_boot_support;
vlog("on_secure_boot_toggled %d\n",g_secure_boot_support );
if (g_secure_boot_support)
{
gtk_widget_show((GtkWidget *)g_image_secure_local);

View File

@ -15,6 +15,7 @@
#include <ventoy_util.h>
#include "ventoy_gtk.h"
static int g_kiosk_mode = 0;
char g_log_file[PATH_MAX];
char g_ini_file[PATH_MAX];
@ -130,6 +131,15 @@ int main(int argc, char *argv[])
return 1;
}
for (i = 0; i < argc; i++)
{
if (argv[i] && strcmp(argv[i], "--kiosk") == 0)
{
g_kiosk_mode = 1;
break;
}
}
snprintf(g_log_file, sizeof(g_log_file), "log.txt");
snprintf(g_ini_file, sizeof(g_ini_file), "./Ventoy2Disk.ini");
for (i = 0; i < argc; i++)
@ -179,12 +189,20 @@ int main(int argc, char *argv[])
return 1;
}
pData = get_refresh_icon_raw_data(&len);
set_image_from_pixbuf(pBuilder, "image_refresh", pData, len);
pData = get_secure_icon_raw_data(&len);
set_image_from_pixbuf(pBuilder, "image_secure_local", pData, len);
set_image_from_pixbuf(pBuilder, "image_secure_dev", pData, len);
if (g_kiosk_mode)
{
gtk_image_set_from_file((GtkImage *)gtk_builder_get_object(pBuilder, "image_refresh"), "/ventoy/refresh.png");
gtk_image_set_from_file((GtkImage *)gtk_builder_get_object(pBuilder, "image_secure_local"), "/ventoy/secure.png");
gtk_image_set_from_file((GtkImage *)gtk_builder_get_object(pBuilder, "image_secure_dev"), "/ventoy/secure.png");
}
else
{
pData = get_refresh_icon_raw_data(&len);
set_image_from_pixbuf(pBuilder, "image_refresh", pData, len);
pData = get_secure_icon_raw_data(&len);
set_image_from_pixbuf(pBuilder, "image_secure_local", pData, len);
set_image_from_pixbuf(pBuilder, "image_secure_dev", pData, len);
}
pWidget = GTK_WIDGET(gtk_builder_get_object(pBuilder, "window"));
gtk_widget_show_all(pWidget);