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

13
src/gui/options.ui

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

8
src/gui/options_imp.cpp

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

15
src/gui/rss/rss.ui

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

4
src/gui/rss/rsssettingsdlg.ui

@ -22,7 +22,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <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> </property>
</widget> </widget>
</item> </item>
@ -94,7 +94,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../icons.qrc"/> <include location="../../icons.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

Loading…
Cancel
Save