mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-22 02:52:23 +00:00
cleanups
This commit is contained in:
parent
55d8522c4b
commit
ed55a157fe
8
main.py
8
main.py
@ -2,7 +2,7 @@ from copy import deepcopy
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from PySide2.QtCore import QFile, QObject, Slot, SIGNAL
|
||||
from PySide2.QtCore import QFile, QObject, Slot
|
||||
from PySide2.QtUiTools import QUiLoader
|
||||
from PySide2.QtWidgets import QApplication, QGraphicsScene
|
||||
|
||||
@ -89,7 +89,7 @@ class Window(QObject):
|
||||
item = mon['item']
|
||||
mon['pos_x'] = item.x()
|
||||
mon['pos_y'] = item.y()
|
||||
self.set_replica_of()
|
||||
self.update_replica_of_data()
|
||||
for _, mon in self.xrandr_info.items():
|
||||
mon['item'].update_visuals(mon)
|
||||
|
||||
@ -136,9 +136,9 @@ class Window(QObject):
|
||||
if "*" in line:
|
||||
print(f"Current mode for {name}: {mode_name}")
|
||||
self.xrandr_info[name]["current_mode"] = mode_name
|
||||
self.set_replica_of()
|
||||
self.update_replica_of_data()
|
||||
|
||||
def set_replica_of(self):
|
||||
def update_replica_of_data(self):
|
||||
for a in self.xrandr_info:
|
||||
self.xrandr_info[a]['replica_of'] = []
|
||||
for b in self.xrandr_info:
|
||||
|
@ -1,12 +1,11 @@
|
||||
from PySide2.QtCore import Qt, Signal, QObject
|
||||
from PySide2.QtCore import Qt, QObject
|
||||
from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsTextItem
|
||||
from PySide2.QtGui import QBrush, QPen
|
||||
from PySide2.QtGui import QBrush
|
||||
|
||||
|
||||
class MonitorItem(QGraphicsRectItem, QObject):
|
||||
z = 0
|
||||
|
||||
|
||||
def __init__(self, *a, **kw):
|
||||
data = kw.pop("data")
|
||||
self.name = kw.pop("name")
|
||||
|
Loading…
Reference in New Issue
Block a user