From 549c2b6fadded11032368589f13be766b187c704 Mon Sep 17 00:00:00 2001
From: Dave Chamberlin-Kidd <dave@flamangoes.co.uk>
Date: Sat, 16 May 2020 23:47:58 +0100
Subject: [PATCH 07/43] Refactor: Extract geometry setup

---
 src/sessionbutton.cpp | 25 +++++++++++--------------
 src/sessionbutton.h   |  1 +
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp
index 6073460..b25e674 100644
--- a/src/sessionbutton.cpp
+++ b/src/sessionbutton.cpp
@@ -82,13 +82,8 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
     sid=id;
 
     setupCommand();
-
-    geomBox=createGeometryBox();
-    geom=new QLabel ( this );
-    geom->setMouseTracking ( true );
-    geomIcon=new QLabel ( this );
-    geomIcon->setMouseTracking ( true );
-
+    setupGeometry();
+ 
     sessName=new QLabel ( this );
     fnt=sessName->font();
     fnt.setBold ( true );
@@ -277,15 +272,17 @@ void SessionButton::setupOptionsPalette( QPalette &cpal )
     cpal.setColor ( QPalette::Window,backgroundColor );
 }
 
-QComboBox* SessionButton::createGeometryBox()
+void SessionButton::setupGeometry()
 {
-    QComboBox* geomBox = new QComboBox( this );
-    geomBox->setMouseTracking( true );
-    geomBox->setFrame( false );
-    geomBox->setEditable( false );
+    geomBox = new QComboBox ( this );
+    geomBox->setMouseTracking ( true );
+    geomBox->setFrame ( false );
+    geomBox->setEditable ( false );
     geomBox->update();
-
-    return geomBox;
+    geom=new QLabel ( this );
+    geom->setMouseTracking ( true );
+    geomIcon=new QLabel ( this );
+    geomIcon->setMouseTracking ( true );
 }
 
 void SessionButton::setupCommand(){
diff --git a/src/sessionbutton.h b/src/sessionbutton.h
index 6fca921..d68639c 100644
--- a/src/sessionbutton.h
+++ b/src/sessionbutton.h
@@ -92,6 +92,7 @@ private:
     void setupOptionsPalette ( QPalette &cpal );
     void setupCommand();
     QComboBox* createGeometryBox();
+    void setupGeometry();
 
 private slots:
     void slotClicked();
-- 
2.27.0

