Skip to content

Commit f94f9f9

Browse files
committed
Fix terminal focusing
1 parent 5553517 commit f94f9f9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

applications/libwindow/inc/libwindow/canvas.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define LIBWINDOW_CANVAS
2323

2424
#include "libwindow/component.hpp"
25+
#include "libwindow/focusable_component.hpp"
2526
#include "libwindow/listener/canvas_buffer_listener.hpp"
2627
#include "libwindow/listener/desktop_canvas_listener.hpp"
2728
#include "libwindow/listener/canvas_buffer_listener_internal.hpp"
@@ -30,6 +31,7 @@
3031
#include <utility>
3132
#include <cairo/cairo.h>
3233

34+
3335
struct g_canvas_buffer_info
3436
{
3537
uint8_t* buffer = nullptr;
@@ -45,7 +47,7 @@ struct g_canvas_buffer_info
4547
* A canvas is a simple component that offers a buffer to the creator for arbitrary painting. This buffer automatically
4648
* resizes when the bounds of the component change, so it is crucial to always keep track of which buffer to paint to.
4749
*/
48-
class g_canvas : virtual public g_component
50+
class g_canvas : virtual public g_component, virtual public g_focusable_component
4951
{
5052
protected:
5153
g_canvas_buffer_info currentBuffer{};
@@ -73,7 +75,7 @@ class g_canvas : virtual public g_component
7375

7476
public:
7577
explicit g_canvas(g_ui_component_id id) :
76-
g_component(id)
78+
g_component(id), g_focusable_component(id)
7779
{
7880
}
7981

applications/navigator/src/navigator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int main()
120120
navUp = g_button::create();
121121
navUp->setTitle("^");
122122
navBar->addChild(navUp);
123-
navBar->setFlexComponentInfo(navUp, 0, 1, 40);
123+
navBar->setFlexComponentInfo(navUp, 0, 1, 50);
124124

125125
navUp->setActionListener([]()
126126
{
@@ -131,7 +131,7 @@ int main()
131131
});
132132
}
133133
window->addChild(navBar);
134-
window->setFlexComponentInfo(navBar, 0, 1, 50);
134+
window->setFlexComponentInfo(navBar, 0, 1, 40);
135135

136136
g_panel* centerPanel = g_panel::create();
137137
centerPanel->setBackground(RGB(255, 255, 255));

applications/terminal/src/screen/gui/gui_screen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ bool gui_screen_t::createUi()
8282
g_rectangle windowBounds = g_rectangle(80, 80, 700, 500);
8383
window->setBounds(windowBounds);
8484
window->setVisible(true);
85-
window->setFocused(true);
8685

8786
window->addListener(G_UI_COMPONENT_EVENT_TYPE_FOCUS, new terminal_focus_listener_t(this));
87+
window->setFocused(true);
8888

8989
window->onClose([this]()
9090
{

kernel/inc/build_config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// version
4949
#define G_VERSION_MAJOR 0
5050
#define G_VERSION_MINOR 22
51-
#define G_VERSION_PATCH 3
51+
#define G_VERSION_PATCH 4
5252

5353
#define G_LOADER_VERSION_MAJOR 1
5454
#define G_LOADER_VERSION_MINOR 1

0 commit comments

Comments
 (0)