Skip to content

Commit 7f768de

Browse files
committed
Beta-1
1 parent f259bf7 commit 7f768de

File tree

16 files changed

+2087
-2045
lines changed

16 files changed

+2087
-2045
lines changed

develnext-doc/src/ide/doc/commands/DocCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function makeUiForRightHead()
7070
$input->width = 170;
7171
}
7272

73-
Ide::get()->setUserConfigValue(__CLASS__ . '.searchQuery', $input);
73+
Ide::get()->setUserConfigValue(__CLASS__ . '.searchQuery', $input->text);
7474
});
7575

7676
$input->text = Ide::get()->getUserConfigValue(__CLASS__ . '.searchQuery', '');

develnext-stdlib/src/behaviour/custom/DraggingFormBehaviour.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use php\gui\framework\behaviour\custom\AbstractBehaviour;
77
use php\gui\UXDialog;
88
use php\gui\UXNode;
9+
use php\gui\UXWindow;
910
use php\util\SharedValue;
1011
use script\TimerScript;
1112

@@ -31,45 +32,49 @@ class DraggingFormBehaviour extends AbstractBehaviour
3132
*/
3233
protected function applyImpl($target)
3334
{
35+
if ($target instanceof UXWindow) {
36+
$target = $target->layout;
37+
}
38+
3439
if ($target instanceof UXNode) {
3540
$pos = new SharedValue(null);
3641

37-
$target->on('mouseDown', function (UXMouseEvent $e) use ($pos) {
42+
$target->on('mouseDown', function (UXMouseEvent $e) use ($pos, $target) {
3843
if (!$this->enabled) {
3944
return;
4045
}
4146

4247
if ($e->button == 'PRIMARY') {
4348
if ($this->opacityEnabled) {
4449
if ($this->animated) {
45-
Animation::fadeTo($this->_target->form, 300, $this->opacity);
50+
Animation::fadeTo($target->form, 300, $this->opacity);
4651
} else {
47-
$this->_target->form->opacity = $this->opacity;
52+
$target->form->opacity = $this->opacity;
4853
}
4954
}
5055

51-
$pos->set([$e->screenX - $this->_target->form->x, $e->screenY - $this->_target->form->y]);
56+
$pos->set([$e->screenX - $target->form->x, $e->screenY - $target->form->y]);
5257
}
5358
}, __CLASS__);
5459

55-
$move = function (UXMouseEvent $e)use ($pos) {
60+
$move = function (UXMouseEvent $e)use ($pos, $target) {
5661
if ($pos->get()) {
57-
$this->_target->form->x = $e->screenX - $pos->get()[0];
58-
$this->_target->form->y = $e->screenY - $pos->get()[1];
62+
$target->form->x = $e->screenX - $pos->get()[0];
63+
$target->form->y = $e->screenY - $pos->get()[1];
5964
}
6065
};
6166

6267
$target->on('mouseDrag', $move, __CLASS__);
6368

64-
$target->on('mouseUp', function (UXMouseEvent $e) use ($pos) {
69+
$target->on('mouseUp', function (UXMouseEvent $e) use ($pos, $target) {
6570
if ($e->button == 'PRIMARY') {
6671
$pos->remove();
6772

6873
if ($this->opacityEnabled) {
6974
if ($this->animated) {
70-
Animation::fadeTo($this->_target->form, 300, 1);
75+
Animation::fadeTo($target->form, 300, 1);
7176
} else {
72-
$this->_target->form->opacity = 1;
77+
$target->form->opacity = 1;
7378
}
7479
}
7580
}

0 commit comments

Comments
 (0)