Symbian fixes.
[dorian] / widgets / dyalog.cpp
index db75c88..fc8d337 100644 (file)
@@ -12,6 +12,8 @@ Dyalog::Dyalog(QWidget *parent, bool showButtons_):
                     Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint),
     showButtons(showButtons_)
 {
+    setAttribute(Qt::WA_DeleteOnClose);
+
     scroller = new QScrollArea(this);
 
 #if defined(Q_WS_MAEMO_5)
@@ -25,6 +27,10 @@ Dyalog::Dyalog(QWidget *parent, bool showButtons_):
 #endif
     scroller->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     scroller->setFrameStyle(QFrame::NoFrame);
+#if defined(Q_OS_SYMBIAN)
+    setStyleSheet("QFrame {margin:0; border:0; padding:0}");
+    setStyleSheet("QScrollArea {margin:0; border:0; padding:0}");
+#endif
 
     content = new QWidget(scroller);
     contentLayout = new QVBoxLayout(content);
@@ -90,27 +96,25 @@ void Dyalog::addButton(const QString &label, QObject *receiver,
     }
 #ifdef Q_OS_SYMBIAN
     Q_UNUSED(role);
-#if 0
     if (!leftSoftKey) {
-        qDebug() << "Adding left soft key";
+        // Add new action as left softkey
         leftSoftKey = new QAction(label, this);
         leftSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
         connect(leftSoftKey, SIGNAL(triggered()), receiver, slot);
         addAction(leftSoftKey);
     } else {
-#endif
         if (!menuBar) {
-            qDebug() << "Creating menu bar";
+            // Create menu bar
             menuBar = new QMenuBar(this);
+            // Add previous LSK to menu bar
+            leftSoftKey->setSoftKeyRole(QAction::NoSoftKey);
             menuBar->addAction(leftSoftKey);
         }
-        qDebug() << "Adding to menu bar";
+        // Add new action to menu bar
         QAction *action = new QAction(label, this);
         connect(action, SIGNAL(triggered()), receiver, slot);
         menuBar->addAction(action);
-#if 0
     }
-#endif
 #else
     QPushButton *button = new QPushButton(label, this);
     connect(button, SIGNAL(clicked()), receiver, slot);