mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Add WindowSelectionWidget
Refreshes list of windows when widget becomes visible to support widget caching
This commit is contained in:
25
plugins/base/utils/window-selection.cpp
Normal file
25
plugins/base/utils/window-selection.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "window-selection.hpp"
|
||||
#include "selection-helpers.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
WindowSelectionWidget::WindowSelectionWidget(QWidget *parent)
|
||||
: FilterComboBox(parent)
|
||||
{
|
||||
setEditable(true);
|
||||
SetAllowUnmatchedSelection(true);
|
||||
setMaxVisibleItems(20);
|
||||
PopulateWindowSelection(this);
|
||||
}
|
||||
|
||||
void WindowSelectionWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
FilterComboBox::showEvent(event);
|
||||
const QSignalBlocker b(this);
|
||||
const auto text = currentText();
|
||||
clear();
|
||||
PopulateWindowSelection(this);
|
||||
setCurrentText(text);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
Reference in New Issue
Block a user