Browse Source

Merge pull request #5137 from Chocobo1/fix_ui

UI fixes
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
ab65c04e0e
  1. 20
      src/gui/lineedit/src/lineedit.cpp
  2. 13
      src/gui/options.ui
  3. 8
      src/gui/options_imp.cpp
  4. 15
      src/gui/rss/rss.ui
  5. 4
      src/gui/rss/rsssettingsdlg.ui

20
src/gui/lineedit/src/lineedit.cpp

@ -16,17 +16,15 @@ @@ -16,17 +16,15 @@
LineEdit::LineEdit(QWidget *parent)
: QLineEdit(parent)
{
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
QPixmap pixmap1(":/lineeditimages/search.png");
searchButton = new QToolButton(this);
searchButton->setIcon(QIcon(pixmap1));
searchButton->setIconSize(pixmap1.size());
searchButton->setCursor(Qt::ArrowCursor);
searchButton->setStyleSheet("QToolButton { border: none; padding: 2px; }");
QSize searchButtonHint = searchButton->sizeHint();
int clearButtonSizeHintWidth = 0;
int clearButtonSizeHintHeight = 0;
QSize clearButtonHint(0, 0);
#ifndef QBT_USES_QT5
QPixmap pixmap2(":/lineeditimages/clear_left.png");
clearButton = new QToolButton(this);
@ -39,17 +37,17 @@ LineEdit::LineEdit(QWidget *parent) @@ -39,17 +37,17 @@ LineEdit::LineEdit(QWidget *parent)
connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &)));
clearButtonSizeHintWidth = clearButton->sizeHint().width();
clearButtonSizeHintHeight = clearButton->sizeHint().height();
setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; }").arg(searchButton->sizeHint().width()).arg(clearButtonSizeHintWidth));
clearButtonHint = clearButton->sizeHint();
setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; }").arg(searchButtonHint.width()).arg(clearButtonHint.width()));
#else
setClearButtonEnabled(true);
setStyleSheet(QString("QLineEdit { padding-left: %1px; }").arg(searchButton->sizeHint().width())); // padding between text and widget borders
setStyleSheet(QString("QLineEdit { padding-left: %1px; }").arg(searchButtonHint.width())); // padding between text and widget borders
#endif
QSize msz = sizeHint();
setMinimumSize(qMax(msz.width(), searchButton->sizeHint().width() + clearButtonSizeHintWidth),
std::max({ msz.height(), searchButton->sizeHint().height(), clearButtonSizeHintHeight }) + frameWidth * 2);
QSize widgetHint = sizeHint();
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
setMaximumHeight(std::max({ widgetHint.height(), searchButtonHint.height(), clearButtonHint.height() }) + frameWidth * 2);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
}
void LineEdit::resizeEvent(QResizeEvent *e)

13
src/gui/options.ui

@ -754,6 +754,9 @@ @@ -754,6 +754,9 @@
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item>
@ -761,6 +764,9 @@ @@ -761,6 +764,9 @@
<property name="text">
<string>Advanced</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item>
@ -1319,7 +1325,11 @@ @@ -1319,7 +1325,11 @@
<widget class="QLineEdit" name="autoRun_txt"/>
</item>
<item>
<widget class="QLabel" name="autoRun_param"/>
<widget class="QLabel" name="autoRun_param">
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
@ -3244,5 +3254,6 @@ @@ -3244,5 +3254,6 @@
</connections>
<buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
</buttongroups>
</ui>

8
src/gui/options_imp.cpp

@ -62,8 +62,8 @@ @@ -62,8 +62,8 @@
// Constructor
options_imp::options_imp(QWidget *parent)
: QDialog(parent),
m_refreshingIpFilter(false)
: QDialog(parent)
, m_refreshingIpFilter(false)
{
qDebug("-> Constructing Options");
setupUi(this);
@ -149,6 +149,7 @@ options_imp::options_imp(QWidget *parent) @@ -149,6 +149,7 @@ options_imp::options_imp(QWidget *parent)
connect(confirmDeletion, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkHideZero, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkHideZero, SIGNAL(toggled(bool)), comboHideZero, SLOT(setEnabled(bool)));
connect(comboHideZero, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -242,6 +243,7 @@ options_imp::options_imp(QWidget *parent) @@ -242,6 +243,7 @@ options_imp::options_imp(QWidget *parent)
connect(schedule_to, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton()));
connect(schedule_days, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(checkuTP, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkuTP, SIGNAL(toggled(bool)), checkLimituTPConnections, SLOT(setEnabled(bool)));
connect(checkLimituTPConnections, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimitTransportOverhead, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimitLocalPeerRate, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
@ -625,6 +627,7 @@ void options_imp::loadOptions() @@ -625,6 +627,7 @@ void options_imp::loadOptions()
confirmDeletion->setChecked(pref->confirmTorrentDeletion());
checkAltRowColors->setChecked(pref->useAlternatingRowColors());
checkHideZero->setChecked(pref->getHideZeroValues());
comboHideZero->setEnabled(checkHideZero->isChecked());
comboHideZero->setCurrentIndex(pref->getHideZeroComboValues());
checkShowSplash->setChecked(!pref->isSplashScreenDisabled());
@ -866,6 +869,7 @@ void options_imp::loadOptions() @@ -866,6 +869,7 @@ void options_imp::loadOptions()
}
checkuTP->setChecked(pref->isuTPEnabled());
checkLimituTPConnections->setEnabled(checkuTP->isChecked());
checkLimituTPConnections->setChecked(pref->isuTPRateLimited());
checkLimitTransportOverhead->setChecked(pref->includeOverheadInLimits());
checkLimitLocalPeerRate->setChecked(!pref->getIgnoreLimitsOnLAN());

15
src/gui/rss/rss.ui

@ -20,36 +20,27 @@ @@ -20,36 +20,27 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="newFeedButton">
<widget class="QPushButton" name="newFeedButton">
<property name="text">
<string>New subscription</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="markReadButton">
<widget class="QPushButton" name="markReadButton">
<property name="text">
<string>Mark items read</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="updateAllButton">
<widget class="QPushButton" name="updateAllButton">
<property name="toolTip">
<string>Refresh RSS streams</string>
</property>
<property name="text">
<string>Update all</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>

4
src/gui/rss/rsssettingsdlg.ui

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/oxygen/application-rss+xml.png</pixmap>
<pixmap resource="../../icons.qrc">:/icons/oxygen/application-rss+xml.png</pixmap>
</property>
</widget>
</item>
@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
</layout>
</widget>
<resources>
<include location="../icons.qrc"/>
<include location="../../icons.qrc"/>
</resources>
<connections>
<connection>

Loading…
Cancel
Save