void DkAdvancedPreference::createLayout() { // load RAW radio buttons QVector<QRadioButton*> loadRawButtons; loadRawButtons.resize(DkSettings::raw_thumb_end); loadRawButtons[DkSettings::raw_thumb_always] = new QRadioButton(tr("Always Load JPG if Embedded"), this); loadRawButtons[DkSettings::raw_thumb_if_large] = new QRadioButton(tr("Load JPG if it Fits the Screen Resolution"), this); loadRawButtons[DkSettings::raw_thumb_never] = new QRadioButton(tr("Always Load RAW Data"), this); // check wrt the current settings loadRawButtons[Settings::param().resources().loadRawThumb]->setChecked(true); QButtonGroup* loadRawButtonGroup = new QButtonGroup(this); loadRawButtonGroup->setObjectName("loadRaw"); loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_always], DkSettings::raw_thumb_always); loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_if_large], DkSettings::raw_thumb_if_large); loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_never], DkSettings::raw_thumb_never); QCheckBox* cbFilterRaw = new QCheckBox(tr("Apply Noise Filtering to RAW Images"), this); cbFilterRaw->setObjectName("filterRaw"); cbFilterRaw->setToolTip(tr("If checked, a noise filter is applied which reduced color noise")); cbFilterRaw->setChecked(Settings::param().resources().filterRawImages); DkGroupWidget* loadRawGroup = new DkGroupWidget(tr("RAW Loader Settings"), this); loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_always]); loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_if_large]); loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_never]); loadRawGroup->addSpace(); loadRawGroup->addWidget(cbFilterRaw); // file loading QCheckBox* cbSaveDeleted = new QCheckBox(tr("Ask to Save Deleted Files"), this); cbSaveDeleted->setObjectName("saveDeleted"); cbSaveDeleted->setToolTip(tr("If checked, nomacs asked to save files which were deleted by other applications")); cbSaveDeleted->setChecked(Settings::param().global().askToSaveDeletedFiles); QCheckBox* cbIgnoreExif = new QCheckBox(tr("Ignore Exif Orientation when Loading"), this); cbIgnoreExif->setObjectName("ignoreExif"); cbIgnoreExif->setToolTip(tr("If checked, images are NOT rotated with respect to their Exif orientation")); cbIgnoreExif->setChecked(Settings::param().metaData().ignoreExifOrientation); QCheckBox* cbSaveExif = new QCheckBox(tr("Save Exif Orientation"), this); cbSaveExif->setObjectName("saveExif"); cbSaveExif->setToolTip(tr("If checked, orientation is written to the Exif rather than rotating the image Matrix\n") + tr("NOTE: this allows for rotating JPGs without loosing information.")); cbSaveExif->setChecked(Settings::param().metaData().saveExifOrientation); DkGroupWidget* loadFileGroup = new DkGroupWidget(tr("File Loading/Saving"), this); loadFileGroup->addWidget(cbSaveDeleted); loadFileGroup->addWidget(cbIgnoreExif); loadFileGroup->addWidget(cbSaveExif); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(loadRawGroup); layout->addWidget(loadFileGroup); }
void DkFilePreference::createLayout() { // temp folder DkDirectoryChooser* dirChooser = new DkDirectoryChooser(Settings::param().global().tmpPath, this); dirChooser->setObjectName("dirChooser"); QLabel* tLabel = new QLabel(tr("Screenshots are automatically saved to this folder"), this); DkGroupWidget* tempFolderGroup = new DkGroupWidget(tr("Use Temporary Folder"), this); tempFolderGroup->addWidget(dirChooser); tempFolderGroup->addWidget(tLabel); // cache size int maxCache = qMax(qRound(DkMemory::getTotalMemory()*0.1), 512); qDebug() << "max cache" << maxCache; QSpinBox* cacheBox = new QSpinBox(this); cacheBox->setObjectName("cacheBox"); cacheBox->setMinimum(0); cacheBox->setMaximum(maxCache); cacheBox->setSuffix(" MB"); cacheBox->setMaximumWidth(200); cacheBox->setValue(qRound(Settings::param().resources().cacheMemory)); QLabel* cLabel = new QLabel(tr("We recommend to set a moderate cache value arround 100 MB"), this); DkGroupWidget* cacheGroup = new DkGroupWidget(tr("Maximal Cache Size"), this); cacheGroup->addWidget(cacheBox); cacheGroup->addWidget(cLabel); // history size // cache size QSpinBox* historyBox = new QSpinBox(this); historyBox->setObjectName("historyBox"); historyBox->setMinimum(0); historyBox->setMaximum(1024); historyBox->setSuffix(" MB"); historyBox->setMaximumWidth(200); historyBox->setValue(qRound(Settings::param().resources().historyMemory)); QLabel* hLabel = new QLabel(tr("We recommend to set a moderate edit history value arround 100 MB"), this); DkGroupWidget* historyGroup = new DkGroupWidget(tr("History Size"), this); historyGroup->addWidget(historyBox); historyGroup->addWidget(hLabel); // loading policy QVector<QRadioButton*> loadButtons; loadButtons.append(new QRadioButton(tr("Skip Images"), this)); loadButtons[0]->setToolTip(tr("Images are skipped until the Next key is released")); loadButtons.append(new QRadioButton(tr("Wait for Images to be Loaded"), this)); loadButtons[1]->setToolTip(tr("The next image is loaded after the current image is shown.")); // check wrt the current settings loadButtons[0]->setChecked(!Settings::param().resources().waitForLastImg); loadButtons[1]->setChecked(Settings::param().resources().waitForLastImg); QButtonGroup* loadButtonGroup = new QButtonGroup(this); loadButtonGroup->setObjectName("loadGroup"); loadButtonGroup->addButton(loadButtons[0], 0); loadButtonGroup->addButton(loadButtons[1], 1); DkGroupWidget* loadGroup = new DkGroupWidget(tr("Image Loading Policy"), this); loadGroup->addWidget(loadButtons[0]); loadGroup->addWidget(loadButtons[1]); // skip images QSpinBox* skipBox = new QSpinBox(this); skipBox->setObjectName("skipBox"); skipBox->setMinimum(2); skipBox->setMaximum(1000); skipBox->setValue(Settings::param().global().skipImgs); skipBox->setMaximumWidth(200); DkGroupWidget* skipGroup = new DkGroupWidget(tr("Number of Skipped Images on PgUp/PgDown"), this); skipGroup->addWidget(skipBox); // left column QWidget* leftWidget = new QWidget(this); QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget); leftLayout->addWidget(tempFolderGroup); leftLayout->addWidget(cacheGroup); leftLayout->addWidget(historyGroup); leftLayout->addWidget(loadGroup); leftLayout->addWidget(skipGroup); QHBoxLayout* layout = new QHBoxLayout(this); layout->setAlignment(Qt::AlignLeft); layout->addWidget(leftWidget); }
void DkDisplayPreference::createLayout() { // zoom settings QCheckBox* invertZoom = new QCheckBox(tr("Invert mouse wheel behaviour for zooming"), this); invertZoom->setObjectName("invertZoom"); invertZoom->setToolTip(tr("If checked, the mouse wheel behaviour is inverted while zooming.")); invertZoom->setChecked(Settings::param().display().invertZoom); QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this); QSpinBox* sbInterpolation = new QSpinBox(this); sbInterpolation->setObjectName("interpolationBox"); sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger.")); sbInterpolation->setSuffix("%"); sbInterpolation->setMinimum(0); sbInterpolation->setMaximum(10000); sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel); DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this); zoomGroup->addWidget(invertZoom); zoomGroup->addWidget(interpolationLabel); zoomGroup->addWidget(sbInterpolation); // keep zoom radio buttons QVector<QRadioButton*> keepZoomButtons; keepZoomButtons.resize(DkSettings::zoom_end); keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this); keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this); keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous.")); keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this); QCheckBox* cbZoomToFit = new QCheckBox(tr("Always zoom to fit"), this); cbZoomToFit->setObjectName("zoomToFit"); cbZoomToFit->setChecked(Settings::param().display().zoomToFit); // check wrt the current settings keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true); QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this); keepZoomButtonGroup->setObjectName("keepZoom"); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep); DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]); keepZoomGroup->addWidget(cbZoomToFit); // icon size QSpinBox* sbIconSize = new QSpinBox(this); sbIconSize->setObjectName("iconSizeBox"); sbIconSize->setToolTip(tr("Define the icon size in pixel.")); sbIconSize->setSuffix(" px"); sbIconSize->setMinimum(16); sbIconSize->setMaximum(1024); sbIconSize->setValue(Settings::param().display().iconSize); DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this); iconGroup->addWidget(sbIconSize); // slideshow QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this); QComboBox* cbTransition = new QComboBox(this); cbTransition->setObjectName("transition"); cbTransition->setToolTip(tr("Choose a transition when loading a new image")); for (int idx = 0; idx < DkSettings::trans_end; idx++) { QString str = tr("Unknown Transition"); switch (idx) { case DkSettings::trans_appear: str = tr("Appear"); break; case DkSettings::trans_swipe: str = tr("Swipe"); break; case DkSettings::trans_fade: str = tr("Fade"); break; } cbTransition->addItem(str); } cbTransition->setCurrentIndex(Settings::param().display().transition); QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this); fadeImageBox->setObjectName("fadeImageBox"); fadeImageBox->setToolTip(tr("Define the image transition speed.")); fadeImageBox->setSuffix(" sec"); fadeImageBox->setMinimum(0.0); fadeImageBox->setMaximum(3); fadeImageBox->setSingleStep(.2); fadeImageBox->setValue(Settings::param().display().animationDuration); QCheckBox* cbAlwaysAnimate = new QCheckBox(tr("Always Animate Image Loading"), this); cbAlwaysAnimate->setObjectName("alwaysAnimate"); cbAlwaysAnimate->setToolTip(tr("If unchecked, loading is only animated if nomacs is fullscreen")); cbAlwaysAnimate->setChecked(Settings::param().display().alwaysAnimate); QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this); QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this); displayTimeBox->setObjectName("displayTimeBox"); displayTimeBox->setToolTip(tr("Define the time an image is displayed.")); displayTimeBox->setSuffix(" sec"); displayTimeBox->setMinimum(0.0); displayTimeBox->setMaximum(30); displayTimeBox->setSingleStep(.2); displayTimeBox->setValue(Settings::param().slideShow().time); DkGroupWidget* slideshowGroup = new DkGroupWidget(tr("Slideshow"), this); slideshowGroup->addWidget(fadeImageLabel); slideshowGroup->addWidget(cbTransition); slideshowGroup->addWidget(fadeImageBox); slideshowGroup->addWidget(cbAlwaysAnimate); slideshowGroup->addWidget(displayTimeLabel); slideshowGroup->addWidget(displayTimeBox); // left column QWidget* leftWidget = new QWidget(this); QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget); leftLayout->setAlignment(Qt::AlignTop); leftLayout->addWidget(zoomGroup); leftLayout->addWidget(keepZoomGroup); leftLayout->addWidget(iconGroup); leftLayout->addWidget(slideshowGroup); // right column QWidget* rightWidget = new QWidget(this); QVBoxLayout* rightLayout = new QVBoxLayout(rightWidget); rightLayout->setAlignment(Qt::AlignTop); QHBoxLayout* layout = new QHBoxLayout(this); layout->setAlignment(Qt::AlignLeft); layout->addWidget(leftWidget); layout->addWidget(rightWidget); }
void DkGeneralPreference::createLayout() { // color settings DkColorChooser* highlightColorChooser = new DkColorChooser(QColor(0, 204, 255), tr("Highlight Color"), this); highlightColorChooser->setObjectName("highlightColor"); highlightColorChooser->setColor(&Settings::param().display().highlightColor); connect(highlightColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkColorChooser* iconColorChooser = new DkColorChooser(QColor(219, 89, 2, 255), tr("Icon Color"), this); iconColorChooser->setObjectName("iconColor"); iconColorChooser->setColor(&Settings::param().display().iconColor); connect(iconColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkColorChooser* bgColorChooser = new DkColorChooser(QColor(100, 100, 100, 255), tr("Background Color"), this); bgColorChooser->setObjectName("backgroundColor"); bgColorChooser->setColor(&Settings::param().display().bgColor); connect(bgColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkColorChooser* fullscreenColorChooser = new DkColorChooser(QColor(86,86,90), tr("Fullscreen Color"), this); fullscreenColorChooser->setObjectName("fullscreenColor"); fullscreenColorChooser->setColor(&Settings::param().slideShow().backgroundColor); connect(fullscreenColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkColorChooser* fgdHUDColorChooser = new DkColorChooser(QColor(255, 255, 255, 255), tr("HUD Foreground Color"), this); fgdHUDColorChooser->setObjectName("fgdHUDColor"); fgdHUDColorChooser->setColor(&Settings::param().display().hudFgdColor); connect(fgdHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkColorChooser* bgHUDColorChooser = new DkColorChooser(QColor(0, 0, 0, 100), tr("HUD Background Color"), this); bgHUDColorChooser->setObjectName("bgHUDColor"); bgHUDColorChooser->setColor((Settings::param().app().appMode == DkSettings::mode_frameless) ? &Settings::param().display().bgColorFrameless : &Settings::param().display().hudBgColor); connect(bgHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel())); DkGroupWidget* colorGroup = new DkGroupWidget(tr("Color Settings"), this); colorGroup->addWidget(highlightColorChooser); colorGroup->addWidget(iconColorChooser); colorGroup->addWidget(bgColorChooser); colorGroup->addWidget(fullscreenColorChooser); colorGroup->addWidget(fgdHUDColorChooser); colorGroup->addWidget(bgHUDColorChooser); // default pushbutton QPushButton* defaultSettings = new QPushButton(tr("Reset All Settings")); defaultSettings->setObjectName("defaultSettings"); defaultSettings->setMaximumWidth(300); DkGroupWidget* defaultGroup = new DkGroupWidget(tr("Default Settings"), this); defaultGroup->addWidget(defaultSettings); // the left column (holding all color settings) QWidget* leftColumn = new QWidget(this); leftColumn->setMinimumWidth(400); QVBoxLayout* leftColumnLayout = new QVBoxLayout(leftColumn); leftColumnLayout->setAlignment(Qt::AlignTop); leftColumnLayout->addWidget(colorGroup); leftColumnLayout->addWidget(defaultGroup); // checkboxes QCheckBox* cbRecentFiles = new QCheckBox(tr("Show Recent Files on Start-Up"), this); cbRecentFiles->setObjectName("showRecentFiles"); cbRecentFiles->setToolTip(tr("Show the History Panel on Start-Up")); cbRecentFiles->setChecked(Settings::param().app().showRecentFiles); QCheckBox* cbLogRecentFiles = new QCheckBox(tr("Log Recent Files"), this); cbLogRecentFiles->setObjectName("logRecentFiles"); cbLogRecentFiles->setToolTip(tr("If checked, recent files will be saved.")); cbLogRecentFiles->setChecked(Settings::param().global().logRecentFiles); QCheckBox* cbLoopImages = new QCheckBox(tr("Loop Images"), this); cbLoopImages->setObjectName("loopImages"); cbLoopImages->setToolTip(tr("Start with the first image in a folder after showing the last.")); cbLoopImages->setChecked(Settings::param().global().loop); QCheckBox* cbZoomOnWheel = new QCheckBox(tr("Mouse Wheel Zooms"), this); cbZoomOnWheel->setObjectName("zoomOnWheel"); cbZoomOnWheel->setToolTip(tr("If checked, the mouse wheel zooms - otherwise it is used to switch between images.")); cbZoomOnWheel->setChecked(Settings::param().global().zoomOnWheel); QCheckBox* cbDoubleClickForFullscreen = new QCheckBox(tr("Double Click Opens Fullscreen"), this); cbDoubleClickForFullscreen->setObjectName("doubleClickForFullscreen"); cbDoubleClickForFullscreen->setToolTip(tr("If checked, a double click on the canvas opens the fullscreen mode.")); cbDoubleClickForFullscreen->setChecked(Settings::param().global().doubleClickForFullscreen); QCheckBox* cbShowBgImage = new QCheckBox(tr("Show Background Image"), this); cbShowBgImage->setObjectName("showBgImage"); cbShowBgImage->setToolTip(tr("If checked, the nomacs logo is shown in the bottom right corner.")); cbShowBgImage->setChecked(Settings::param().global().showBgImage); QCheckBox* cbSwitchModifier = new QCheckBox(tr("Switch CTRL with ALT"), this); cbSwitchModifier->setObjectName("switchModifier"); cbSwitchModifier->setToolTip(tr("If checked, CTRL + Mouse is switched with ALT + Mouse.")); cbSwitchModifier->setChecked(Settings::param().sync().switchModifier); QCheckBox* cbEnableNetworkSync = new QCheckBox(tr("Enable LAN Sync"), this); cbEnableNetworkSync->setObjectName("networkSync"); cbEnableNetworkSync->setToolTip(tr("If checked, syncing in your LAN is enabled.")); cbEnableNetworkSync->setChecked(Settings::param().sync().enableNetworkSync); QCheckBox* cbCloseOnEsc = new QCheckBox(tr("Close on ESC"), this); cbCloseOnEsc->setObjectName("closeOnEsc"); cbCloseOnEsc->setToolTip(tr("Close nomacs if ESC is pressed.")); cbCloseOnEsc->setChecked(Settings::param().app().closeOnEsc); QCheckBox* cbCheckForUpdates = new QCheckBox(tr("Check For Updates"), this); cbCheckForUpdates->setObjectName("checkForUpdates"); cbCheckForUpdates->setToolTip(tr("Check for updates on start-up.")); cbCheckForUpdates->setChecked(Settings::param().sync().checkForUpdates); DkGroupWidget* generalGroup = new DkGroupWidget(tr("General"), this); generalGroup->addWidget(cbRecentFiles); generalGroup->addWidget(cbLogRecentFiles); generalGroup->addWidget(cbLoopImages); generalGroup->addWidget(cbZoomOnWheel); generalGroup->addWidget(cbDoubleClickForFullscreen); generalGroup->addWidget(cbSwitchModifier); generalGroup->addWidget(cbEnableNetworkSync); generalGroup->addWidget(cbCloseOnEsc); generalGroup->addWidget(cbCheckForUpdates); generalGroup->addWidget(cbShowBgImage); // language QComboBox* languageCombo = new QComboBox(this); languageCombo->setObjectName("languageCombo"); languageCombo->setToolTip(tr("Choose your preferred language.")); DkUtils::addLanguages(languageCombo, mLanguages); languageCombo->setCurrentIndex(mLanguages.indexOf(Settings::param().global().language)); QLabel* translateLabel = new QLabel("<a href=\"http://www.nomacs.org/how-to-translate-nomacs/\">How-to translate nomacs</a>", this); translateLabel->setToolTip(tr("Info on how to translate nomacs.")); translateLabel->setOpenExternalLinks(true); DkGroupWidget* languageGroup = new DkGroupWidget(tr("Language"), this); languageGroup->addWidget(languageCombo); languageGroup->addWidget(translateLabel); // the right column (holding all checkboxes) QWidget* cbWidget = new QWidget(this); QVBoxLayout* cbLayout = new QVBoxLayout(cbWidget); cbLayout->setAlignment(Qt::AlignTop); cbLayout->addWidget(generalGroup); // add language cbLayout->addWidget(languageGroup); QHBoxLayout* contentLayout = new QHBoxLayout(this); contentLayout->setAlignment(Qt::AlignLeft); contentLayout->addWidget(leftColumn); contentLayout->addWidget(cbWidget); }
void DkDisplayPreference::createLayout() { // zoom settings QCheckBox* invertZoom = new QCheckBox(tr("Invert zoom wheel behaviour"), this); invertZoom->setObjectName("invertZoom"); invertZoom->setChecked(Settings::param().display().invertZoom); QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this); QSpinBox* sbInterpolation = new QSpinBox(this); sbInterpolation->setObjectName("interpolationBox"); sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger.")); sbInterpolation->setSuffix("%"); sbInterpolation->setMinimum(0); sbInterpolation->setMaximum(10000); sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel); DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this); zoomGroup->addWidget(invertZoom); zoomGroup->addWidget(interpolationLabel); zoomGroup->addWidget(sbInterpolation); // keep zoom radio buttons QVector<QRadioButton*> keepZoomButtons; keepZoomButtons.resize(DkSettings::zoom_end); keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this); keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this); keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous.")); keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this); // check wrt the current settings keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true); QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this); keepZoomButtonGroup->setObjectName("keepZoom"); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size); keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep); DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]); keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]); // icon size QSpinBox* sbIconSize = new QSpinBox(this); sbIconSize->setObjectName("iconSizeBox"); sbIconSize->setToolTip(tr("Define the icon size in pixel.")); sbIconSize->setSuffix(" px"); sbIconSize->setMinimum(16); sbIconSize->setMaximum(1024); sbIconSize->setValue(Settings::param().display().iconSize); DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this); iconGroup->addWidget(sbIconSize); // slideshow QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this); QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this); fadeImageBox->setObjectName("fadeImageBox"); fadeImageBox->setToolTip(tr("Define the image transition speed.")); fadeImageBox->setSuffix(" sec"); fadeImageBox->setMinimum(0.0); fadeImageBox->setMaximum(3); fadeImageBox->setSingleStep(.2); fadeImageBox->setValue(Settings::param().display().fadeSec); QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this); QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this); displayTimeBox->setObjectName("displayTimeBox"); displayTimeBox->setToolTip(tr("Define the time an image is displayed.")); displayTimeBox->setSuffix(" sec"); displayTimeBox->setMinimum(0.0); displayTimeBox->setMaximum(30); displayTimeBox->setSingleStep(.2); displayTimeBox->setValue(Settings::param().slideShow().time); DkGroupWidget* slideshowGroup = new DkGroupWidget(tr("Slideshow"), this); slideshowGroup->addWidget(fadeImageLabel); slideshowGroup->addWidget(fadeImageBox); slideshowGroup->addWidget(displayTimeLabel); slideshowGroup->addWidget(displayTimeBox); // left column QWidget* leftWidget = new QWidget(this); QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget); leftLayout->setAlignment(Qt::AlignTop); leftLayout->addWidget(zoomGroup); leftLayout->addWidget(keepZoomGroup); leftLayout->addWidget(iconGroup); leftLayout->addWidget(slideshowGroup); // right column QWidget* rightWidget = new QWidget(this); QVBoxLayout* rightLayout = new QVBoxLayout(rightWidget); rightLayout->setAlignment(Qt::AlignTop); QHBoxLayout* layout = new QHBoxLayout(this); layout->setAlignment(Qt::AlignLeft); layout->addWidget(leftWidget); layout->addWidget(rightWidget); }