summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.h
diff options
context:
space:
mode:
authorSimon Rettberg2016-11-02 19:24:07 +0100
committerSimon Rettberg2016-11-02 19:24:07 +0100
commit9d73e385153656ef998cc8f6378bb01ff36b2090 (patch)
treee73108ab31a56bd310af25b9e0623378480fb2bd /src/server/mainwindow/mainwindow.h
parent[server] Run "manager only" logic before creating main window (diff)
downloadpvs2-9d73e385153656ef998cc8f6378bb01ff36b2090.tar.gz
pvs2-9d73e385153656ef998cc8f6378bb01ff36b2090.tar.xz
pvs2-9d73e385153656ef998cc8f6378bb01ff36b2090.zip
[server] Rewrite positioning logic of connection frames
This fixes sevceral bugs: * Frames moved into virtually expanded area (for keeping aspect ratio) could be out of bounds after a window resize before * Finding a free slot to place a frame was slightly sped up * Finding a free slot is not used when loading a room layout, as it was (still is) pretty sluggish for the user * Snap to grid worked incorrectly, did not pick closest grid position
Diffstat (limited to 'src/server/mainwindow/mainwindow.h')
-rw-r--r--src/server/mainwindow/mainwindow.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h
index b0ad498..988ac50 100644
--- a/src/server/mainwindow/mainwindow.h
+++ b/src/server/mainwindow/mainwindow.h
@@ -30,6 +30,8 @@ public:
MainWindow(QWidget *parent = 0);
~MainWindow();
+ QRect calcFrameGeometry(ConnectionFrame* frame) const;
+
private:
// Ui stuff
@@ -75,9 +77,9 @@ private:
DiscoveryListener *_discoveryListener;
QPoint closestFreeSlot(QPoint preferredPixels, ConnectionFrame* toIgnore);
- void placeFrameInFreeSlot(ConnectionFrame* frame, QPoint preferred = QPoint(0, 0));
+ void placeFrameInFreeSlot(ConnectionFrame* frame, QPoint preferred = QPoint(-1, -1));
ConnectionFrame* createFrame();
- ConnectionFrame* createFrame(QString computerId, QPoint position, QPoint gridPosition);
+ ConnectionFrame* createFrame(QString computerId, QPoint gridPosition);
void savePosition(ConnectionFrame *cf);
void startVncServerIfNecessary(int from);
void tellClientCurrentSituation(Client* client);
@@ -122,7 +124,7 @@ protected slots:
void DisableButtons();
void EnableButtons();
// connection frame
- void onPlaceFrame(bool activateTrash, ConnectionFrame* frame);
+ void onPlaceFrame(ConnectionFrame* frame);
void onFrameClicked(ConnectionFrame* frame);
// Net
void onClientConnected(Client* client);