Skip to content

Commit

Permalink
Add set_as_desktop method to DesktopWindow class
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinDecima committed Dec 21, 2023
1 parent 6facbaf commit c235f77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DesktopWindow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from Vasak.VSKWindow import VSKWindow
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
from src.DesktopBinding import DesktopBinding

class DesktopWindow(VSKWindow):
Expand All @@ -11,7 +12,13 @@ def __init__(self):
self.set_as_desktop() # Hacer que la ventana se comporte como un dock
self.load_html("ui/dist/index.html") # Cargar un HTML en el WebView


# Mover la ventana a una pantalla específica
def move_to_screen(self):
self.setGeometry(0, 0, QApplication.primaryScreen().availableGeometry().width(), QApplication.primaryScreen().availableGeometry().height())
self.setGeometry(0, 0, QApplication.primaryScreen().availableGeometry().width(), QApplication.primaryScreen().availableGeometry().height())

def set_as_desktop(self):
self.setAttribute(Qt.WidgetAttribute.WA_X11NetWmWindowTypeDesktop, True) # Seteo tipo desktop x11
self.setAttribute(Qt.WidgetAttribute.WA_AlwaysStackOnTop, False)
self.setWindowFlags(
self.windowFlags() | Qt.WindowType.FramelessWindowHint | Qt.WindowType.Desktop
)

0 comments on commit c235f77

Please sign in to comment.