📄 kglookfeel.cpp
字号:
tabWidget->insertTab( tab_4, i18n( "Panel Toolbar" ) ); QBoxLayout * panelToolbarVLayout = new QVBoxLayout( tab_4 ); panelToolbarVLayout->setSpacing( 6 ); panelToolbarVLayout->setMargin( 11 ); KONFIGURATOR_CHECKBOX_PARAM panelToolbarActiveCheckbox[] = // cfg_class cfg_name default text restart tooltip {{"Look&Feel", "Panel Toolbar visible", _PanelToolBar, i18n( "Show Panel Toolbar" ), true, i18n( "The panel toolbar will be visible." ) } }; panelToolbarActive = createCheckBoxGroup( 1, 0, panelToolbarActiveCheckbox, 1, tab_4, "panelToolbarActive", PAGE_PANELTOOLBAR); connect( panelToolbarActive->find( "Panel Toolbar visible" ), SIGNAL( stateChanged( int ) ), this, SLOT( slotEnablePanelToolbar() ) ); QGroupBox * panelToolbarGrp = createFrame( i18n( "Visible Panel Toolbar buttons" ), tab_4, "panelToolbarGrp"); QGridLayout * panelToolbarGrid = createGridLayout( panelToolbarGrp->layout() ); KONFIGURATOR_CHECKBOX_PARAM panelToolbarCheckboxes[] = { // cfg_class cfg_name default text restart tooltip {"Look&Feel", "Clear Location Bar Visible", _ClearLocation, i18n( "Clear location bar button" ), true , i18n( "Clears the location bar" ) }, {"Look&Feel", "Open Button Visible", _Open, i18n( "Open button" ), true , i18n( "Opens the directory browser." ) }, {"Look&Feel", "Equal Button Visible", _cdOther, i18n( "Equal button (=)" ),true , i18n( "Changes the panel directory to the other panel directory." ) }, {"Look&Feel", "Up Button Visible", _cdUp, i18n( "Up button (..)" ), true , i18n( "Changes the panel directory to the parent directory." ) }, {"Look&Feel", "Home Button Visible", _cdHome, i18n( "Home button (~)" ), true , i18n( "Changes the panel directory to the home directory." ) }, {"Look&Feel", "Root Button Visible", _cdRoot, i18n( "Root button (/)" ), true , i18n( "Changes the panel directory to the root directory." ) }, {"Look&Feel", "SyncBrowse Button Visible", _syncBrowseButton, i18n( "Toggle-button for sync-browsing" ), true , i18n( "Each directory change in the panel is also performed in the other panel." ) }, }; pnlcbs = createCheckBoxGroup(1, 0, panelToolbarCheckboxes, 7, panelToolbarGrp, "panelToolbarChecks", PAGE_PANELTOOLBAR); panelToolbarVLayout->addWidget( panelToolbarActive, 0, 0 ); panelToolbarGrid->addWidget( pnlcbs, 0, 0 ); panelToolbarVLayout->addWidget( panelToolbarGrp, 1, 0 ); // Enable panel toolbar checkboxes slotEnablePanelToolbar();}// ---------------------------------------------------------------------------// -------------------------- Mouse TAB ----------------------------------// ---------------------------------------------------------------------------void KgLookFeel::setupMouseModeTab() { QWidget *tab_mouse = new QWidget( tabWidget, "tab_mouse" ); tabWidget->insertTab( tab_mouse, i18n( "Selection Mode" ) ); QGridLayout *mouseLayout = new QGridLayout( tab_mouse ); mouseLayout->setSpacing( 6 ); mouseLayout->setMargin( 11 ); // -------------- General ----------------- QGroupBox *mouseGeneralGroup = createFrame( i18n( "General" ), tab_mouse, "mouseGeneralGroup" ); QGridLayout *mouseGeneralGrid = createGridLayout( mouseGeneralGroup->layout() ); mouseGeneralGrid->setSpacing( 0 ); mouseGeneralGrid->setMargin( 5 ); KONFIGURATOR_NAME_VALUE_TIP mouseSelection[] = { // name value tooltip { i18n( "Krusader Mode" ), "0", i18n( "Both keys allow selecting files. To select more than one file, hold the Ctrl key and click the left mouse button. Right-click menu is invoked using a short click on the right mouse button." ) }, { i18n( "Konqueror Mode" ), "1", i18n( "Pressing the left mouse button selects files - you can click and select multiple files. Right-click menu is invoked using a short click on the right mouse button." ) }, { i18n( "Total-Commander Mode" ), "2", i18n( "The left mouse button does not select, but sets the current file without affecting the current selection. The right mouse button selects multiple files and the right-click menu is invoked by pressing and holding the right mouse button." ) }, { i18n( "Custom Selection Mode" ), "3", i18n( "Design your own selection mode!" ) } }; mouseRadio = createRadioButtonGroup( "Look&Feel", "Mouse Selection", "0", 2, 2, mouseSelection, 4, mouseGeneralGroup, "myLook&FeelRadio", true, PAGE_MOUSE ); mouseRadio->layout()->setMargin( 0 ); mouseGeneralGrid->addWidget( mouseRadio, 0, 0 ); connect( mouseRadio, SIGNAL( clicked(int) ), SLOT( slotSelectionModeChanged() ) ); mouseLayout->addMultiCellWidget( mouseGeneralGroup, 0,0, 0,1 ); // -------------- Details ----------------- QGroupBox *mouseDetailGroup = createFrame( i18n( "Details" ), tab_mouse, "mouseDetailGroup" ); QGridLayout *mouseDetailGrid = createGridLayout( mouseDetailGroup->layout() ); mouseDetailGrid->setSpacing( 0 ); mouseDetailGrid->setMargin( 5 ); KONFIGURATOR_NAME_VALUE_TIP singleOrDoubleClick[] = { // name value tooltip { i18n( "Double-click selects (classic)" ), "0", i18n( "A single click on a file will select and focus, a double click opens the file or steps into the directory." ) }, { i18n( "Obey KDE's global selection policy" ), "1", i18n( "<p>Use KDE's global setting:</p><p><i>KDE Control Center -> Peripherals -> Mouse</i></p>" ) } }; KonfiguratorRadioButtons *clickRadio = createRadioButtonGroup( "Look&Feel", "Single Click Selects", "0", 1, 0, singleOrDoubleClick, 2, mouseDetailGroup, "myLook&FeelRadio0", true, PAGE_MOUSE ); clickRadio->layout()->setMargin( 0 ); mouseDetailGrid->addWidget( clickRadio, 0, 0 ); KONFIGURATOR_CHECKBOX_PARAM mouseCheckboxesParam[] = { // {cfg_class, cfg_name, default // text, restart, // tooltip } {"Custom Selection Mode", "QT Selection", _QtSelection, i18n( "Based on KDE's selection mode" ), true, i18n( "If checked, use a mode based on KDE's style." ) }, {"Custom Selection Mode", "Left Selects", _LeftSelects, i18n( "Left mouse button selects" ), true, i18n( "If checked, left clicking an item will select it." ) }, {"Custom Selection Mode", "Left Preserves", _LeftPreserves, i18n( "Left mouse button preserves selection" ), true, i18n( "If checked, left clicking an item will select it, but will not unselect other, already selected items." ) }, {"Custom Selection Mode", "ShiftCtrl Left Selects", _ShiftCtrlLeft, i18n( "Shift/Ctrl-Left mouse button selects" ), true, i18n( "If checked, shift/ctrl left clicking will select items. \nNote: This is meaningless if 'Left Button Selects' is checked." ) }, {"Custom Selection Mode", "Right Selects", _RightSelects, i18n( "Right mouse button selects" ), true, i18n( "If checked, right clicking an item will select it." ) }, {"Custom Selection Mode", "Right Preserves", _RightPreserves, i18n( "Right mouse button preserves selection" ), true, i18n( "If checked, right clicking an item will select it, but will not unselect other, already selected items." ) }, {"Custom Selection Mode", "ShiftCtrl Right Selects", _ShiftCtrlRight, i18n( "Shift/Ctrl-Right mouse button selects" ), true, i18n( "If checked, shift/ctrl right clicking will select items. \nNote: This is meaningless if 'Right Button Selects' is checked." ) }, {"Custom Selection Mode", "Space Moves Down", _SpaceMovesDown, i18n( "Spacebar moves down" ), true, i18n( "If checked, pressing the spacebar will select the current item and move down. \nOtherwise, current item is selected, but remains the current item." ) }, {"Custom Selection Mode", "Space Calc Space", _SpaceCalcSpace, i18n( "Spacebar calculates disk space" ), true, i18n( "If checked, pressing the spacebar while the current item is a folder, will (except from selecting the folder) \ncalculate space occupied by the folder (recursively)." ) }, {"Custom Selection Mode", "Insert Moves Down", _InsertMovesDown, i18n( "Insert moves down" ), true, i18n( "If checked, pressing INSERT will select the current item, and move down to the next item. \nOtherwise, current item is not changed." ) }, {"Custom Selection Mode", "Immediate Context Menu", _ImmediateContextMenu, i18n( "Right clicking pops context menu immediately" ), true, i18n( "If checked, right clicking will result in an immediate showing of the context menu. \nOtherwise, user needs to click and hold the right mouse button for 500ms." ) }, }; mouseCheckboxes = createCheckBoxGroup(1, 0, mouseCheckboxesParam, 11 /*count*/, mouseDetailGroup, "customMouseModeChecks", PAGE_MOUSE); mouseDetailGrid->addWidget( mouseCheckboxes, 1, 0 ); mouseLayout->addWidget( mouseDetailGroup, 1,0 ); // Disable the details-button if not in custom-mode slotSelectionModeChanged(); // -------------- Preview ----------------- QGroupBox *mousePreviewGroup = createFrame( i18n( "Preview" ), tab_mouse, "mousePreviewGroup" ); QGridLayout *mousePreviewGrid = createGridLayout( mousePreviewGroup->layout() ); // TODO preview mousePreview = new QListView( mousePreviewGroup, "mousePreview" ); mousePreviewGrid->addWidget( mousePreview, 0 ,0 ); mousePreviewGroup->setEnabled(false); // TODO re-enable once the preview is implemented // ------------------------------------------ mouseLayout->addWidget( mousePreviewGroup, 1,1 );}void KgLookFeel::slotDisable(){ bool isNewStyleQuickSearch = quicksearchCheckboxes->find( "New Style Quicksearch" )->isChecked(); quicksearchCheckboxes->find( "Case Sensitive Quicksearch" )->setEnabled( isNewStyleQuickSearch );}void KgLookFeel::slotEnablePanelToolbar(){ bool enableTB = panelToolbarActive->find("Panel Toolbar visible")->isChecked(); pnlcbs->find( "Root Button Visible" )->setEnabled(enableTB); pnlcbs->find( "Home Button Visible" )->setEnabled(enableTB); pnlcbs->find( "Up Button Visible" )->setEnabled(enableTB); pnlcbs->find( "Equal Button Visible" )->setEnabled(enableTB); pnlcbs->find( "Open Button Visible" )->setEnabled(enableTB); pnlcbs->find("SyncBrowse Button Visible")->setEnabled(enableTB); }void KgLookFeel::slotSelectionModeChanged() { bool enable = mouseRadio->find( i18n("Custom Selection Mode") )->isChecked(); mouseCheckboxes->find( "QT Selection" )->setEnabled( enable ); mouseCheckboxes->find( "Left Selects" )->setEnabled( enable ); mouseCheckboxes->find( "Left Preserves" )->setEnabled( enable ); mouseCheckboxes->find( "ShiftCtrl Left Selects" )->setEnabled( enable ); mouseCheckboxes->find( "Right Selects" )->setEnabled( enable ); mouseCheckboxes->find( "Right Preserves" )->setEnabled( enable ); mouseCheckboxes->find( "ShiftCtrl Right Selects" )->setEnabled( enable ); mouseCheckboxes->find( "Space Moves Down" )->setEnabled( enable ); mouseCheckboxes->find( "Space Calc Space" )->setEnabled( enable ); mouseCheckboxes->find( "Insert Moves Down" )->setEnabled( enable ); mouseCheckboxes->find( "Immediate Context Menu" )->setEnabled( enable );}int KgLookFeel::activeSubPage() { return tabWidget->currentPageIndex();}#include "kglookfeel.moc"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -