Fixed #6283 - Smeared dialog
authorBartosz Szatkowski <bulislaw@linux.com>
Wed, 1 Sep 2010 08:13:00 +0000 (10:13 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Wed, 1 Sep 2010 08:13:00 +0000 (10:13 +0200)
When we put file name on label, long enough to fall partialy in blind
spot all window become smeared, now I move button to line belowe so its
more space for label

trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp
trunk/src/plugins/xdxf/src/XdxfLoadDialog.h

index 99f6759..4bb5282 100644 (file)
 
 XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) :
     QDialog(parent) {
-    verticalLayout = new QVBoxLayout(this);
+    verticalLayout = new QVBoxLayout;
     setLayout(verticalLayout);
 
     setWindowTitle(tr("Add new XDXF dictionary"));
 
-    browseLayout = new QHBoxLayout(this);
-    verticalLayout->addLayout(browseLayout);
+    browseLayout = new QVBoxLayout;
 
-    browseButton =  new QPushButton(tr("Browse"),this);
-    browseLabel = new QLabel(tr("Dictionary file: not selected"),this);
+    browseButton =  new QPushButton(tr("Browse"));
+    browseLabel = new QLabel(tr("Dictionary file: not selected"));
+    //browseLabel->setWordWrap(true);
+    browseLabel->setMargin(5);
 
-    browseLayout->addWidget(browseLabel);
-    browseLayout->addWidget(browseButton,0, Qt::AlignRight);
+    browseLayout->addWidget(browseLabel, 0, Qt::AlignLeft);
+    browseLayout->addWidget(browseButton);
 
+    verticalLayout->addLayout(browseLayout);
 
-    cacheLayout = new QHBoxLayout(this);
+    cacheLayout = new QHBoxLayout;
     verticalLayout->addLayout(cacheLayout);
     accentsCheckBox = new QCheckBox(tr("Strip accents \n(searching takes more time, "
                  "but spelling don't have to be exact)"));
@@ -52,7 +54,7 @@ XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) :
     cacheCheckBox->setChecked(true);
     cacheLayout->addWidget(cacheCheckBox);
 
-    addButton = new QPushButton(tr("Add"),this);
+    addButton = new QPushButton(tr("Add"));
 
     verticalLayout->addWidget(addButton);
 
@@ -74,10 +76,13 @@ void XdxfLoadDialog::selectFile() {
                                      tr("XDXF Files (*.xdxf)"),
                                      NULL,
                                      NULL);
+
     if (!fileName.isEmpty()) {
-        browseLabel->setText(tr("Dictionary file: ") + fileName);
+        qDebug()<<fileName;
+        browseLabel->setText(tr("Dictionary file: %1").arg(fileName));
         _dicitonaryFilePath = fileName;
-    }
+    }repaint(rect());
+    resize(size());
 }
 
 void XdxfLoadDialog::addDictionary() {
index 58a3bd2..de2750f 100644 (file)
@@ -62,7 +62,7 @@ private:
     QCheckBox* cacheCheckBox;
     QCheckBox* accentsCheckBox;
     QVBoxLayout* verticalLayout;
-    QHBoxLayout* browseLayout;
+    QVBoxLayout* browseLayout;
     QHBoxLayout* cacheLayout;
     QString _dicitonaryFilePath;
     bool _generateCache;