mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Made preferences columns resizable
This commit is contained in:
parent
bd292076e3
commit
6431343ad7
@ -56,6 +56,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
||||
|
||||
QString savePath;
|
||||
setupUi(this);
|
||||
hsplitter->setCollapsible(0, false);
|
||||
hsplitter->setCollapsible(1, false);
|
||||
// Get apply button in button box
|
||||
QList<QAbstractButton *> buttons = buttonBox->buttons();
|
||||
foreach(QAbstractButton *button, buttons){
|
||||
@ -284,8 +286,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
||||
scrollArea_advanced->setLayout(adv_layout);
|
||||
connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton()));
|
||||
// Adapt size
|
||||
loadWindowState();
|
||||
show();
|
||||
loadWindowState();
|
||||
}
|
||||
|
||||
// Main destructor
|
||||
@ -313,12 +315,29 @@ void options_imp::loadWindowState() {
|
||||
QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint();
|
||||
if(!p.isNull())
|
||||
move(p);
|
||||
// Load slider size
|
||||
const QStringList &sizes_str = settings.value("Preferences/State/hSplitterSizes", QStringList()).toStringList();
|
||||
// Splitter size
|
||||
QList<int> sizes;
|
||||
if(sizes_str.size() == 2) {
|
||||
sizes << sizes_str.first().toInt();
|
||||
sizes << sizes_str.last().toInt();
|
||||
} else {
|
||||
sizes << 130;
|
||||
sizes << hsplitter->width()-130;
|
||||
}
|
||||
hsplitter->setSizes(sizes);
|
||||
}
|
||||
|
||||
void options_imp::saveWindowState() const {
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
settings.setValue(QString::fromUtf8("Preferences/State/size"), size());
|
||||
settings.setValue(QString::fromUtf8("Preferences/State/pos"), pos());
|
||||
// Splitter size
|
||||
QStringList sizes_str;
|
||||
sizes_str << QString::number(hsplitter->sizes().first());
|
||||
sizes_str << QString::number(hsplitter->sizes().last());
|
||||
settings.setValue(QString::fromUtf8("Preferences/State/hSplitterSizes"), sizes_str);
|
||||
}
|
||||
|
||||
QSize options_imp::sizeFittingScreen() {
|
||||
|
5907
src/ui/options.ui
5907
src/ui/options.ui
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user