From c7dc423eeea5eb2e96f6d59152b8434b69899eab Mon Sep 17 00:00:00 2001 From: D3V1L0N <167227445+D3V1L0N@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:35:56 +0530 Subject: [PATCH] Contribution on ui SplashScreen.py --- blackbox/ui/SplashScreen.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 blackbox/ui/SplashScreen.py diff --git a/blackbox/ui/SplashScreen.py b/blackbox/ui/SplashScreen.py new file mode 100644 index 0000000..f2ad00d --- /dev/null +++ b/blackbox/ui/SplashScreen.py @@ -0,0 +1,30 @@ +import gi +from Functions import os + +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk, GdkPixbuf, Gdk # noqa + +base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +# base_dir = os.path.dirname(os.path.realpath(__file__)) + + +class SplashScreen(Gtk.Window): + def __init__(self): + Gtk.Window.__init__(self, Gtk.WindowType.POPUP, title="") + self.set_decorated(False) + self.set_resizable(False) + self.set_size_request(600, 400) + self.set_position(Gtk.WindowPosition.CENTER) + + main_vbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=1) + self.add(main_vbox) + + self.image = Gtk.Image() + pimage = GdkPixbuf.Pixbuf().new_from_file_at_size( + base_dir + "/images/splash.png", 600, 400 + ) + self.image.set_from_pixbuf(pimage) + + main_vbox.pack_start(self.image, True, True, 0) + + self.show_all()