Removed context menu icons from QPlainTextEdit widget
This commit is contained in:
@@ -14,6 +14,7 @@ target_sources(
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/RotatableLabel.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/RotatableLabel.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TextInput.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/TextInput.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/PlainTextEdit.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/SvgWidget.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/SvgWidget.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/SvgToolButton.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/SvgToolButton.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "Widgets/RotatableLabel.hpp"
|
#include "Widgets/RotatableLabel.hpp"
|
||||||
#include "Widgets/LabeledSeparator.hpp"
|
#include "Widgets/LabeledSeparator.hpp"
|
||||||
#include "Widgets/TextInput.hpp"
|
#include "Widgets/TextInput.hpp"
|
||||||
|
#include "Widgets/PlainTextEdit.hpp"
|
||||||
#include "Widgets/PushButton.hpp"
|
#include "Widgets/PushButton.hpp"
|
||||||
#include "Widgets/SvgWidget.hpp"
|
#include "Widgets/SvgWidget.hpp"
|
||||||
#include "Widgets/SvgToolButton.hpp"
|
#include "Widgets/SvgToolButton.hpp"
|
||||||
@@ -55,6 +56,15 @@ namespace Bloom
|
|||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PlainTextEdit",
|
||||||
|
[this] (QWidget* parent, const QString& name) {
|
||||||
|
auto* widget = new PlainTextEdit(parent);
|
||||||
|
widget->setObjectName(name);
|
||||||
|
widget->setStyleSheet(parent->styleSheet());
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"PushButton",
|
"PushButton",
|
||||||
[this] (QWidget* parent, const QString& name) {
|
[this] (QWidget* parent, const QString& name) {
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#include "PlainTextEdit.hpp"
|
||||||
|
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
namespace Bloom::Widgets
|
||||||
|
{
|
||||||
|
PlainTextEdit::PlainTextEdit(QWidget* parent)
|
||||||
|
: QPlainTextEdit(parent)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void PlainTextEdit::contextMenuEvent(QContextMenuEvent* event) {
|
||||||
|
if (QMenu* menu = this->createStandardContextMenu()) {
|
||||||
|
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
|
// Remove default icons
|
||||||
|
for (auto& action : menu->actions()) {
|
||||||
|
action->setIcon(QIcon());
|
||||||
|
}
|
||||||
|
|
||||||
|
menu->popup(event->globalPos());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QPlainTextEdit>
|
||||||
|
#include <QContextMenuEvent>
|
||||||
|
|
||||||
|
namespace Bloom::Widgets
|
||||||
|
{
|
||||||
|
class PlainTextEdit: public QPlainTextEdit
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PlainTextEdit(QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void contextMenuEvent(QContextMenuEvent* event) override;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPlainTextEdit" name="description-input">
|
<widget class="PlainTextEdit" name="description-input">
|
||||||
<property name="minimumHeight">
|
<property name="minimumHeight">
|
||||||
<number>100</number>
|
<number>100</number>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QMargins>
|
#include <QMargins>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QPlainTextEdit>
|
|
||||||
|
|
||||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||||
#include "src/Insight/InsightSignals.hpp"
|
#include "src/Insight/InsightSignals.hpp"
|
||||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||||
|
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/PlainTextEdit.hpp"
|
||||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp"
|
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp"
|
||||||
|
|
||||||
|
|
||||||
#include "src/Services/PathService.hpp"
|
#include "src/Services/PathService.hpp"
|
||||||
#include "src/Exceptions/Exception.hpp"
|
#include "src/Exceptions/Exception.hpp"
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ namespace Bloom::Widgets
|
|||||||
auto* registerDetailsSizeInput = registerDetailsContainer->findChild<QLineEdit*>(
|
auto* registerDetailsSizeInput = registerDetailsContainer->findChild<QLineEdit*>(
|
||||||
"register-details-size-input"
|
"register-details-size-input"
|
||||||
);
|
);
|
||||||
auto* registerDetailsDescriptionInput = registerDetailsContainer->findChild<QPlainTextEdit*>(
|
auto* registerDetailsDescriptionInput = registerDetailsContainer->findChild<PlainTextEdit*>(
|
||||||
"register-details-description-input"
|
"register-details-description-input"
|
||||||
);
|
);
|
||||||
registerDetailsNameInput->setText(registerName);
|
registerDetailsNameInput->setText(registerName);
|
||||||
|
|||||||
@@ -242,7 +242,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPlainTextEdit" name="register-details-description-input">
|
<widget class="PlainTextEdit" name="register-details-description-input">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user