mirror of https://github.com/adamdruppe/arsd.git
fix #363 on Windows too
This commit is contained in:
parent
918268356a
commit
bd524763fc
59
minigui.d
59
minigui.d
|
@ -12518,8 +12518,7 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
}
|
||||
else static assert(false);
|
||||
|
||||
version(trash_text) {
|
||||
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_mousedown(MouseDownEvent ev) {
|
||||
super.defaultEventHandler_mousedown(ev);
|
||||
|
@ -12543,12 +12542,14 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
}
|
||||
}
|
||||
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_mouseup(MouseUpEvent ev) {
|
||||
//this.parentWindow.win.releaseInputGrab();
|
||||
super.defaultEventHandler_mouseup(ev);
|
||||
}
|
||||
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_mousemove(MouseMoveEvent ev) {
|
||||
super.defaultEventHandler_mousemove(ev);
|
||||
|
@ -12558,6 +12559,7 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
}
|
||||
}
|
||||
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_focus(Event ev) {
|
||||
super.defaultEventHandler_focus(ev);
|
||||
|
@ -12593,28 +12595,46 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
});
|
||||
}
|
||||
|
||||
private string lastContentBlur;
|
||||
version(trash_text) {
|
||||
private string lastContentBlur;
|
||||
|
||||
override void defaultEventHandler_blur(Event ev) {
|
||||
super.defaultEventHandler_blur(ev);
|
||||
if(parentWindow.win.closed) return;
|
||||
version(custom_widgets) {
|
||||
auto painter = this.draw();
|
||||
textLayout.eraseCaret(painter);
|
||||
static if(SimpledisplayTimerAvailable)
|
||||
if(caretTimer) {
|
||||
caretTimer.destroy();
|
||||
caretTimer = null;
|
||||
override void defaultEventHandler_blur(Event ev) {
|
||||
super.defaultEventHandler_blur(ev);
|
||||
if(parentWindow.win.closed) return;
|
||||
version(custom_widgets) {
|
||||
auto painter = this.draw();
|
||||
textLayout.eraseCaret(painter);
|
||||
static if(SimpledisplayTimerAvailable)
|
||||
if(caretTimer) {
|
||||
caretTimer.destroy();
|
||||
caretTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.content != lastContentBlur) {
|
||||
auto evt = new ChangeEvent!string(this, &this.content);
|
||||
evt.dispatch();
|
||||
lastContentBlur = this.content;
|
||||
if(this.content != lastContentBlur) {
|
||||
auto evt = new ChangeEvent!string(this, &this.content);
|
||||
evt.dispatch();
|
||||
lastContentBlur = this.content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
version(win32_widgets) {
|
||||
private string lastContentBlur;
|
||||
|
||||
override void defaultEventHandler_blur(Event ev) {
|
||||
super.defaultEventHandler_blur(ev);
|
||||
|
||||
if(this.content != lastContentBlur) {
|
||||
auto evt = new ChangeEvent!string(this, &this.content);
|
||||
evt.dispatch();
|
||||
lastContentBlur = this.content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_char(CharEvent ev) {
|
||||
super.defaultEventHandler_char(ev);
|
||||
|
@ -12625,6 +12645,7 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
auto cbb = textLayout.contentBoundingBox();
|
||||
setContentSize(cbb.width, cbb.height);
|
||||
}
|
||||
version(trash_text)
|
||||
version(custom_widgets)
|
||||
override void defaultEventHandler_keydown(KeyDownEvent ev) {
|
||||
//super.defaultEventHandler_keydown(ev);
|
||||
|
@ -12680,8 +12701,6 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
|
|||
ensureVisibleInScroll(textLayout.caretBoundingBox());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
version(use_new_text_system) {
|
||||
bool showingVerticalScroll() { return true; }
|
||||
bool showingHorizontalScroll() { return true; }
|
||||
|
|
Loading…
Reference in New Issue