| Summary: | Krita keeps producing windows when using Text tool with a tablet stylus | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Eckhart Wörner <ewoerner> |
| Component: | General | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.6 | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Eckhart Wörner
2006-10-22 23:36:44 UTC
Note: this is a regression; with version 1.5.2 it did not produce more than one window. SVN commit 599736 by berger:
fix the text tool going made when use with the tablet in 1.6, don't close the bug as we might want a better solution for 2.0
CCBUG:136151
M +2 -2 kis_tool_fill.cc
M +11 -1 kis_tool_text.cc
M +2 -0 kis_tool_text.h
--- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_fill.cc #599735:599736
@@ -143,11 +143,11 @@
void KisToolFill::buttonRelease(KisButtonReleaseEvent *e)
{
- if(!m_wasPressed) return;
- m_wasPressed = false;
if (!m_subject) return;
if (!m_currentImage || !m_currentImage->activeDevice()) return;
if (e->button() != QMouseEvent::LeftButton) return;
+ if(!m_wasPressed) return;
+ m_wasPressed = false;
int x, y;
x = m_startPos.floorX();
y = m_startPos.floorY();
--- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_text.cc #599735:599736
@@ -45,12 +45,13 @@
#include "kis_tool_text.h"
#include "kis_paint_device.h"
#include "kis_canvas_subject.h"
+#include "kis_button_press_event.h"
#include "kis_button_release_event.h"
#include "kis_color.h"
#include "kis_undo_adapter.h"
KisToolText::KisToolText()
- : super(i18n("Text"))
+ : super(i18n("Text")), m_wasPressed(false)
{
setName("tool_text");
m_subject = 0;
@@ -67,9 +68,18 @@
super::update(subject);
}
+void KisToolText::buttonPress(KisButtonPressEvent *e)
+{
+ if (m_subject && e->button() == QMouseEvent::LeftButton) {
+ m_wasPressed = true;
+ }
+}
+
void KisToolText::buttonRelease(KisButtonReleaseEvent *e)
{
if (m_subject && e->button() == QMouseEvent::LeftButton) {
+ if(!m_wasPressed) return;
+ m_wasPressed = false;
KisImageSP img = m_subject->currentImg();
bool ok;
--- branches/koffice/1.6/koffice/krita/plugins/tools/defaulttools/kis_tool_text.h #599735:599736
@@ -43,6 +43,7 @@
virtual void setup(KActionCollection *collection);
virtual enumToolType toolType() { return TOOL_FILL; }
virtual Q_UINT32 priority() { return 2; }
+ virtual void buttonPress(KisButtonPressEvent*);
virtual void buttonRelease(KisButtonReleaseEvent *e);
virtual QWidget* createOptionWidget(QWidget* parent);
@@ -55,6 +56,7 @@
QLabel *m_lbFont;
KSqueezedTextLabel *m_lbFontName;
QPushButton *m_btnMoreFonts;
+ bool m_wasPressed; // use for preventing bug:136151
};
Krita still produces a new window each time touching and releasing even if there's already a window, but this is no grave problem anymore. This is fixed too; I'm closing this bug since the text tool will be gone in 2.0, where we'll be using the flake text shape instead. |