From 16b63d329d6818dbe58e4693e5f74493b3473df8 Mon Sep 17 00:00:00 2001 From: 13923402541 Date: Sat, 9 Oct 2021 13:24:09 +0000 Subject: [PATCH 1/2] fix widget_test's keyboardtest --- tests/gui/widget_tests.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/gui/widget_tests.cc b/tests/gui/widget_tests.cc index 3138b45d..7f8cc314 100755 --- a/tests/gui/widget_tests.cc +++ b/tests/gui/widget_tests.cc @@ -178,7 +178,8 @@ TEST_F(WIDGET,Keyboard){ Window*w=new Window(100,100,800,400); KeyboardView*kbv=new KeyboardView(800,300); kbv->setBackgroundColor(0xFFEEEEEE); - kbv->setKeyboard(Keyboard::loadFrom("qwerty.json")); + Keyboard*kbd = new Keyboard(&app,"cdroid:xml/qwerty.xml",800,200); + kbv->setKeyboard(kbd); w->addView(kbv).setPos(20,10); app.exec(); } From 86f6c40ebfc46396e59d79970e46c3f06f82644a Mon Sep 17 00:00:00 2001 From: 13923402541 Date: Sat, 9 Oct 2021 13:36:26 +0000 Subject: [PATCH 2/2] fix scrollbardrawable's thumb --- src/gui/drawables/scrollbardrawable.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/drawables/scrollbardrawable.cc b/src/gui/drawables/scrollbardrawable.cc index 38492a0f..e0193c25 100755 --- a/src/gui/drawables/scrollbardrawable.cc +++ b/src/gui/drawables/scrollbardrawable.cc @@ -120,14 +120,12 @@ void ScrollBarDrawable::drawThumb(Canvas& canvas,const Rect& bounds, int offset, if (vertical) { if (mVerticalThumb != nullptr) { if (changed) - mVerticalThumb->setBounds(bounds.left, bounds.top + offset,bounds.width, offset + length); - + mVerticalThumb->setBounds(bounds.left, bounds.top + offset,bounds.width, length); mVerticalThumb->draw(canvas); } } else if ( mHorizontalThumb ) { if (changed) - mHorizontalThumb->setBounds(bounds.left+ offset, bounds.top,offset + length, bounds.height); - + mHorizontalThumb->setBounds(bounds.left+ offset, bounds.top,length, bounds.height);:wq mHorizontalThumb->draw(canvas); } }