diff --git a/gtk2/common/common.h b/gtk2/common/common.h --- a/gtk2/common/common.h +++ b/gtk2/common/common.h @@ -703,9 +703,10 @@ noMenuBgndOpacityApps, noBgndImageApps; Strings noMenuStripeApps; - // for completeness: + // for completeness, unused: bool onlyTicksInMenu; bool buttonStyleMenuSections; + int menuCloseDelay; } Options; void qtcSetupGradient(Gradient *grad, EGradientBorder border, int numStops, ...); diff --git a/gtk2/common/config_file.cpp b/gtk2/common/config_file.cpp --- a/gtk2/common/config_file.cpp +++ b/gtk2/common/config_file.cpp @@ -1241,6 +1241,7 @@ CFG_READ_ROUND(round); CFG_READ_INT(highlightFactor); CFG_READ_INT(menuDelay); + CFG_READ_INT(menuCloseDelay); CFG_READ_INT(sliderWidth); CFG_READ_INT(tabBgnd); CFG_READ_TB_BORDER(toolbarBorders); @@ -1613,6 +1614,7 @@ opts->splitterHighlight=DEFAULT_SPLITTER_HIGHLIGHT_FACTOR; opts->crSize=CR_LARGE_SIZE; opts->menuDelay=DEFAULT_MENU_DELAY; + opts->menuCloseDelay=-1; // unused opts->sliderWidth=DEFAULT_SLIDER_WIDTH; opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT; opts->fadeLines=true; diff --git a/qt4/common/common.h b/qt4/common/common.h --- a/qt4/common/common.h +++ b/qt4/common/common.h @@ -155,6 +155,10 @@ #define MIN_MENU_DELAY 1 #define MAX_MENU_DELAY 500 +#define DEFAULT_MENU_CLOSE_DELAY 300 +#define MIN_MENU_CLOSE_DELAY 0 +#define MAX_MENU_CLOSE_DELAY 5000 + #define DEFAULT_SLIDER_WIDTH 15 #define MIN_SLIDER_WIDTH_ROUND 7 #define MIN_SLIDER_WIDTH_THIN_GROOVE 9 @@ -723,6 +727,7 @@ highlightFactor, lighterPopupMenuBgnd, menuDelay, + menuCloseDelay, sliderWidth, tabBgnd, colorSelTab, diff --git a/qt4/common/config_file.cpp b/qt4/common/config_file.cpp --- a/qt4/common/config_file.cpp +++ b/qt4/common/config_file.cpp @@ -933,6 +933,9 @@ else if(opts->menuDelaymenuDelay>MAX_MENU_DELAY) opts->menuDelay=DEFAULT_MENU_DELAY; + if(opts->menuCloseDelaymenuCloseDelay>MAX_MENU_CLOSE_DELAY) + opts->menuCloseDelay=DEFAULT_MENU_CLOSE_DELAY; + if(0==opts->sliderWidth%2) opts->sliderWidth++; @@ -1166,6 +1169,7 @@ CFG_READ_ROUND(round); CFG_READ_INT(highlightFactor); CFG_READ_INT(menuDelay); + CFG_READ_INT(menuCloseDelay); CFG_READ_INT(sliderWidth); CFG_READ_INT(tabBgnd); CFG_READ_TB_BORDER(toolbarBorders); @@ -1461,6 +1465,7 @@ opts->splitterHighlight=DEFAULT_SPLITTER_HIGHLIGHT_FACTOR; opts->crSize=CR_LARGE_SIZE; opts->menuDelay=DEFAULT_MENU_DELAY; + opts->menuCloseDelay=DEFAULT_MENU_CLOSE_DELAY; opts->sliderWidth=DEFAULT_SLIDER_WIDTH; opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT; opts->fadeLines=true; @@ -2192,6 +2197,7 @@ CFG_WRITE_ENTRY(round); CFG_WRITE_ENTRY_NUM(highlightFactor); CFG_WRITE_ENTRY_NUM(menuDelay); + CFG_WRITE_ENTRY_NUM(menuCloseDelay); CFG_WRITE_ENTRY_NUM(sliderWidth); CFG_WRITE_ENTRY(toolbarBorders); CFG_WRITE_APPEARANCE_ENTRY(appearance, APP_ALLOW_BASIC); diff --git a/qt4/config/qtcurveconfig.cpp b/qt4/config/qtcurveconfig.cpp --- a/qt4/config/qtcurveconfig.cpp +++ b/qt4/config/qtcurveconfig.cpp @@ -948,6 +948,9 @@ menuDelay->setRange(MIN_MENU_DELAY, MAX_MENU_DELAY); menuDelay->setValue(DEFAULT_MENU_DELAY); + menuCloseDelay->setRange(MIN_MENU_CLOSE_DELAY, MAX_MENU_CLOSE_DELAY); + menuCloseDelay->setValue(DEFAULT_MENU_CLOSE_DELAY); + gbFactor->setRange(MIN_GB_FACTOR, MAX_GB_FACTOR); gbFactor->setValue(DEF_GB_FACTOR); @@ -985,6 +988,7 @@ connect(lighterPopupMenuBgnd, SIGNAL(valueChanged(int)), SLOT(updateChanged())); connect(tabBgnd, SIGNAL(valueChanged(int)), SLOT(updateChanged())); connect(menuDelay, SIGNAL(valueChanged(int)), SLOT(updateChanged())); + connect(menuCloseDelay, SIGNAL(valueChanged(int)), SLOT(updateChanged())); connect(sliderWidth, SIGNAL(valueChanged(int)), SLOT(sliderWidthChanged())); connect(menuStripe, SIGNAL(currentIndexChanged(int)), SLOT(menuStripeChanged())); connect(customMenuStripeColor, SIGNAL(changed(const QColor &)), SLOT(updateChanged())); @@ -2980,6 +2984,7 @@ opts.lighterPopupMenuBgnd=lighterPopupMenuBgnd->value(); opts.tabBgnd=tabBgnd->value(); opts.menuDelay=menuDelay->value(); + opts.menuCloseDelay=menuCloseDelay->value(); opts.sliderWidth=sliderWidth->value(); opts.menuStripe=(EShade)menuStripe->currentIndex(); opts.customMenuStripeColor=customMenuStripeColor->color(); @@ -3222,6 +3227,7 @@ lighterPopupMenuBgnd->setValue(opts.lighterPopupMenuBgnd); tabBgnd->setValue(opts.tabBgnd); menuDelay->setValue(opts.menuDelay); + menuCloseDelay->setValue(opts.menuCloseDelay); sliderWidth->setValue(opts.sliderWidth); menuStripe->setCurrentIndex(opts.menuStripe); customMenuStripeColor->setColor(opts.customMenuStripeColor); @@ -3660,6 +3666,7 @@ lighterPopupMenuBgnd->value()!=opts.lighterPopupMenuBgnd || tabBgnd->value()!=opts.tabBgnd || menuDelay->value()!=opts.menuDelay || + menuCloseDelay->value()!=opts.menuCloseDelay || sliderWidth->value()!=opts.sliderWidth || menuStripe->currentIndex()!=opts.menuStripe || menuStripeAppearance->currentIndex()!=opts.menuStripeAppearance || diff --git a/qt4/config/qtcurveconfigbase.ui b/qt4/config/qtcurveconfigbase.ui --- a/qt4/config/qtcurveconfigbase.ui +++ b/qt4/config/qtcurveconfigbase.ui @@ -3265,21 +3265,38 @@ + + + + <p>Defines the delay before a sub-menu closes. Applicable on Qt 5.5 or later + + + ms + + + + + + Sub-menu close delay: + + + + Stripe: - + <p>Defines the coloration of the menu-stripe that will be drawn on the left of popup menus - but only if this option is not set to 'none'. - + false @@ -3295,7 +3312,7 @@ - + false @@ -3305,14 +3322,14 @@ - + Border popupmenus: - + <p>If enabled, the whole popup menu will have a border, otherwise no border will be drawn. This option should be enabled unless you have also enabled shadows in your window manager. @@ -3322,14 +3339,14 @@ - + Use menubar colour settings: - + Enabled diff --git a/qt5/common/common.h b/qt5/common/common.h --- a/qt5/common/common.h +++ b/qt5/common/common.h @@ -154,6 +154,10 @@ #define MIN_MENU_DELAY 1 #define MAX_MENU_DELAY 500 +#define DEFAULT_MENU_CLOSE_DELAY 300 +#define MIN_MENU_CLOSE_DELAY 0 +#define MAX_MENU_CLOSE_DELAY 5000 + #define DEFAULT_SLIDER_WIDTH 15 #define MIN_SLIDER_WIDTH_ROUND 7 #define MIN_SLIDER_WIDTH_THIN_GROOVE 9 @@ -717,6 +721,7 @@ highlightFactor, lighterPopupMenuBgnd, menuDelay, + menuCloseDelay, sliderWidth, tabBgnd, colorSelTab, diff --git a/qt5/common/config_file.cpp b/qt5/common/config_file.cpp --- a/qt5/common/config_file.cpp +++ b/qt5/common/config_file.cpp @@ -942,6 +942,9 @@ else if(opts->menuDelaymenuDelay>MAX_MENU_DELAY) opts->menuDelay=DEFAULT_MENU_DELAY; + if(opts->menuCloseDelaymenuCloseDelay>MAX_MENU_CLOSE_DELAY) + opts->menuCloseDelay=DEFAULT_MENU_CLOSE_DELAY; + if(0==opts->sliderWidth%2) opts->sliderWidth++; @@ -1173,6 +1176,7 @@ CFG_READ_ROUND(round); CFG_READ_INT(highlightFactor); CFG_READ_INT(menuDelay); + CFG_READ_INT(menuCloseDelay); CFG_READ_INT(sliderWidth); CFG_READ_INT(tabBgnd); CFG_READ_TB_BORDER(toolbarBorders); @@ -1476,6 +1480,7 @@ opts->splitterHighlight=DEFAULT_SPLITTER_HIGHLIGHT_FACTOR; opts->crSize=CR_LARGE_SIZE; opts->menuDelay=DEFAULT_MENU_DELAY; + opts->menuCloseDelay=DEFAULT_MENU_CLOSE_DELAY; opts->sliderWidth=DEFAULT_SLIDER_WIDTH; opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT; opts->fadeLines=true; @@ -2204,6 +2209,7 @@ CFG_WRITE_ENTRY(round); CFG_WRITE_ENTRY_NUM(highlightFactor); CFG_WRITE_ENTRY_NUM(menuDelay); + CFG_WRITE_ENTRY_NUM(menuCloseDelay); CFG_WRITE_ENTRY_NUM(sliderWidth); CFG_WRITE_ENTRY(toolbarBorders); CFG_WRITE_APPEARANCE_ENTRY(appearance, APP_ALLOW_BASIC); diff --git a/qt5/config/qtcurveconfig.cpp b/qt5/config/qtcurveconfig.cpp --- a/qt5/config/qtcurveconfig.cpp +++ b/qt5/config/qtcurveconfig.cpp @@ -957,6 +957,9 @@ menuDelay->setRange(MIN_MENU_DELAY, MAX_MENU_DELAY); menuDelay->setValue(DEFAULT_MENU_DELAY); + menuCloseDelay->setRange(MIN_MENU_CLOSE_DELAY, MAX_MENU_CLOSE_DELAY); + menuCloseDelay->setValue(DEFAULT_MENU_CLOSE_DELAY); + gbFactor->setRange(MIN_GB_FACTOR, MAX_GB_FACTOR); gbFactor->setValue(DEF_GB_FACTOR); @@ -995,7 +998,7 @@ CImagePropertiesDialog::POS| CImagePropertiesDialog::SCALE); - for (auto *w: {lighterPopupMenuBgnd, tabBgnd, menuDelay, crHighlight, + for (auto *w: {lighterPopupMenuBgnd, tabBgnd, menuDelay, menuCloseDelay, crHighlight, expanderHighlight, colorSelTab, highlightFactor, bgndOpacity, dlgOpacity, menuBgndOpacity, splitterHighlight, gbFactor}) { connect(qtcSlot(w, valueChanged, (int)), qtcSlot(this, updateChanged)); @@ -2944,6 +2947,7 @@ opts.lighterPopupMenuBgnd=lighterPopupMenuBgnd->value(); opts.tabBgnd=tabBgnd->value(); opts.menuDelay=menuDelay->value(); + opts.menuCloseDelay=menuCloseDelay->value(); opts.sliderWidth=sliderWidth->value(); opts.menuStripe=(EShade)menuStripe->currentIndex(); opts.customMenuStripeColor=customMenuStripeColor->color(); @@ -3188,6 +3192,7 @@ lighterPopupMenuBgnd->setValue(opts.lighterPopupMenuBgnd); tabBgnd->setValue(opts.tabBgnd); menuDelay->setValue(opts.menuDelay); + menuCloseDelay->setValue(opts.menuCloseDelay); sliderWidth->setValue(opts.sliderWidth); menuStripe->setCurrentIndex(opts.menuStripe); customMenuStripeColor->setColor(opts.customMenuStripeColor); diff --git a/qt5/config/qtcurveconfigbase.ui b/qt5/config/qtcurveconfigbase.ui --- a/qt5/config/qtcurveconfigbase.ui +++ b/qt5/config/qtcurveconfigbase.ui @@ -3312,7 +3312,7 @@ - Sub-menu delay: + Sub-menu open delay: @@ -3329,21 +3329,21 @@ - + Stripe: - + <p>Defines the coloration of the menu-stripe that will be drawn on the left of popup menus - but only if this option is not set to 'none'. - + false @@ -3359,7 +3359,7 @@ - + false @@ -3369,14 +3369,14 @@ - + Border popupmenus: - + <p>If enabled, the whole popup menu will have a border, otherwise no border will be drawn. This option should be enabled unless you have also enabled shadows in your window manager. @@ -3386,14 +3386,14 @@ - + Use menubar colour settings: - + Enabled @@ -3413,6 +3413,23 @@ + + + + Defines the delay before a sub-menu closes. Applicable on Qt5.5 or later + + + ms + + + + + + + Sub-menu close delay: + + + diff --git a/qt5/style/qtcurve_api.cpp b/qt5/style/qtcurve_api.cpp --- a/qt5/style/qtcurve_api.cpp +++ b/qt5/style/qtcurve_api.cpp @@ -1812,6 +1812,12 @@ } case SH_Menu_SubMenuPopupDelay: return opts.menuDelay; +#if QT_VERSION >= QT_VERSION_CHECK(5,5,0) + case SH_Menu_SloppySubMenus: + return opts.menuCloseDelay > 0; + case SH_Menu_SubMenuSloppyCloseTimeout: + return opts.menuCloseDelay; +#endif case SH_ToolButton_PopupDelay: return 250; case SH_ComboBox_PopupFrameStyle: