mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-23 18:40:02 +00:00
Fixed LayoutBase::FocusPrev, and wired up shift+tab support in Main.cpp.
This commit is contained in:
parent
c3217bf65c
commit
c7a0377632
@ -122,13 +122,7 @@ static void changeLayout(WindowState& current, ILayoutPtr newLayout) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void focusNextInLayout(WindowState& current) {
|
static void checkDrawCursor(WindowState& current) {
|
||||||
if (!current.layout) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateFocusedWindow(current, current.layout->FocusNext());
|
|
||||||
|
|
||||||
if (current.input != NULL) {
|
if (current.input != NULL) {
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
@ -141,6 +135,24 @@ static void focusNextInLayout(WindowState& current) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void focusNextInLayout(WindowState& current) {
|
||||||
|
if (!current.layout) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFocusedWindow(current, current.layout->FocusNext());
|
||||||
|
checkDrawCursor(current);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void focusPrevInLayout(WindowState& current) {
|
||||||
|
if (!current.layout) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFocusedWindow(current, current.layout->FocusPrev());
|
||||||
|
checkDrawCursor(current);
|
||||||
|
}
|
||||||
|
|
||||||
static inline std::string readKeyPress(int64 ch) {
|
static inline std::string readKeyPress(int64 ch) {
|
||||||
std::string kn = keyname((int)ch);
|
std::string kn = keyname((int)ch);
|
||||||
|
|
||||||
@ -285,6 +297,9 @@ int main(int argc, char* argv[])
|
|||||||
if (ch == '\t') { /* tab */
|
if (ch == '\t') { /* tab */
|
||||||
focusNextInLayout(state);
|
focusNextInLayout(state);
|
||||||
}
|
}
|
||||||
|
else if (kn == "KEY_BTAB") { /* shift-tab */
|
||||||
|
focusPrevInLayout(state);
|
||||||
|
}
|
||||||
else if (kn == "^D") { /* ctrl+d quits */
|
else if (kn == "^D") { /* ctrl+d quits */
|
||||||
quit = true;
|
quit = true;
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ IWindowPtr LayoutBase::FocusNext() {
|
|||||||
|
|
||||||
IWindowPtr LayoutBase::FocusPrev() {
|
IWindowPtr LayoutBase::FocusPrev() {
|
||||||
IWindowPtr oldFocus = GetFocus();
|
IWindowPtr oldFocus = GetFocus();
|
||||||
if (--this->focused <= 0) {
|
if (--this->focused < 0) {
|
||||||
this->focused = (int) this->focusable.size() - 1;
|
this->focused = (int) this->focusable.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user