SceneSwitcher/plugins/base/utils/window-selection.cpp
WarmUpTill c281c6db83 Add WindowSelectionWidget
Refreshes list of windows when widget becomes visible to support widget
caching
2025-05-27 22:37:46 +02:00

26 lines
538 B
C++

#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