New custom TextInput widget (derived from QLineEdit) to use for text input fields. It currently just removes the default (theme-based) icons from context menu actions
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include "TextInput.hpp"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
|
||||
using namespace Bloom::Widgets;
|
||||
|
||||
TextInput::TextInput(QWidget* parent): QLineEdit(parent) {}
|
||||
|
||||
void TextInput::contextMenuEvent(QContextMenuEvent* event) {
|
||||
if (QMenu *menu = createStandardContextMenu()) {
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
// Remove default icons
|
||||
for (auto& action : menu->actions()) {
|
||||
action->setIcon(QIcon());
|
||||
}
|
||||
|
||||
menu->popup(event->globalPos());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user