Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# SPDX-FileCopyrightText: 2024 Manuel Alcaraz Zambrano <manuelalcarazzam@gmail.com>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
import sys
|
||||
|
||||
from KWidgetsAddons import KLed
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
|
||||
class KLedDemo(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.text = QtWidgets.QLabel("KLed example")
|
||||
self.led = KLed()
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.addWidget(self.text)
|
||||
self.layout.addWidget(self.led)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
widget = KLedDemo()
|
||||
widget.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
@@ -0,0 +1,50 @@
|
||||
# SPDX-FileCopyrightText: 2024 Manuel Alcaraz Zambrano <manuelalcarazzam@gmail.com>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
import sys
|
||||
|
||||
from KWidgetsAddons import KMessageWidget
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class KMessageWidgetDemo(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.text = QtWidgets.QLabel("KMessageWidget demo", alignment=QtCore.Qt.AlignCenter)
|
||||
|
||||
self.message_type = QtWidgets.QComboBox()
|
||||
self.message_type.addItems(["Positive", "Information", "Warning", "Error"])
|
||||
|
||||
self.button = QtWidgets.QPushButton("Show message")
|
||||
self.button.clicked.connect(self.show_message)
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.addWidget(self.text)
|
||||
self.layout.addWidget(self.message_type)
|
||||
self.layout.addWidget(self.button)
|
||||
|
||||
def show_message(self):
|
||||
self.message = KMessageWidget("Be carefull!")
|
||||
|
||||
match self.message_type.currentText():
|
||||
case "Positive":
|
||||
self.message.setMessageType(KMessageWidget.MessageType.Positive)
|
||||
case "Information":
|
||||
self.message.setMessageType(KMessageWidget.MessageType.Information)
|
||||
case "Warning":
|
||||
self.message.setMessageType(KMessageWidget.MessageType.Warning)
|
||||
case "Error":
|
||||
self.message.setMessageType(KMessageWidget.MessageType.Error)
|
||||
|
||||
self.layout.insertWidget(0, self.message)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
widget = KMessageWidgetDemo()
|
||||
widget.resize(500, 500)
|
||||
widget.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
@@ -0,0 +1,36 @@
|
||||
# SPDX-FileCopyrightText: 2024 Manuel Alcaraz Zambrano <manuelalcarazzam@gmail.com>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
import sys
|
||||
|
||||
from KWidgetsAddons import KPasswordDialog
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
|
||||
class KPasswordDialogDemo(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.text = QtWidgets.QLabel("KPasswordDialog example")
|
||||
|
||||
self.button = QtWidgets.QPushButton("Change password")
|
||||
self.button.clicked.connect(self.open_dialog)
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.addWidget(self.text)
|
||||
self.layout.addWidget(self.button)
|
||||
|
||||
def open_dialog(self):
|
||||
self.dialog = KPasswordDialog(self)
|
||||
self.dialog.setPrompt("Enter a password")
|
||||
self.dialog.gotPassword.connect(lambda password: self.text.setText(f"Your password is: {password}"))
|
||||
self.dialog.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
widget = KPasswordDialogDemo()
|
||||
widget.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
@@ -0,0 +1,31 @@
|
||||
# SPDX-FileCopyrightText: 2024 Manuel Alcaraz Zambrano <manuelalcarazzam@gmail.com>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
import sys
|
||||
|
||||
from KWidgetsAddons import KSeparator
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class KSeparatorDemo(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.text = QtWidgets.QLabel("Hey there's a separator below me", alignment=QtCore.Qt.AlignCenter)
|
||||
self.separator = KSeparator()
|
||||
self.text2 = QtWidgets.QLabel("I'm below the separator", alignment=QtCore.Qt.AlignCenter)
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.addWidget(self.text)
|
||||
self.layout.addWidget(self.separator)
|
||||
self.layout.addWidget(self.text2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
widget = KSeparatorDemo()
|
||||
widget.resize(500, 200)
|
||||
widget.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
Reference in New Issue
Block a user