[gnome-shell/wip/carlosg/osk-updates: 39/43] keyboard: Always use ratio of visible level
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/osk-updates: 39/43] keyboard: Always use ratio of visible level
- Date: Wed, 15 Jun 2022 16:12:46 +0000 (UTC)
commit 72f18ecf4d6447367f45fbeee9fbe44c960ac693
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon May 30 23:12:51 2022 +0200
keyboard: Always use ratio of visible level
Since the OSK keymap actors are cached, we no longer update the aspect
container ratio as often as we should. Ensure to update the aspect ratio
with language/level changes.
js/ui/keyboard.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 5e545c693b..6bf364af40 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -127,7 +127,7 @@ class KeyContainer extends St.Widget {
this._maxCols = Math.max(this._currentCol, this._maxCols);
}
- layoutButtons(container) {
+ layoutButtons() {
let nCol = 0, nRow = 0;
for (let i = 0; i < this._rows.length; i++) {
@@ -154,9 +154,10 @@ class KeyContainer extends St.Widget {
nRow += KEY_SIZE;
nCol = 0;
}
+ }
- if (container)
- container.setRatio(this._maxCols, this._rows.length);
+ getRatio() {
+ return [this._maxCols, this._rows.length];
}
});
@@ -1467,7 +1468,7 @@ var Keyboard = GObject.registerClass({
this._loadRows(currentLevel, level, levels.length, layout);
layers[level] = layout;
this._aspectContainer.add_child(layout);
- layout.layoutButtons(this._aspectContainer);
+ layout.layoutButtons();
layout.hide();
}
@@ -1866,6 +1867,7 @@ var Keyboard = GObject.registerClass({
this._currentPage = null;
});
this._updateCurrentPageVisible();
+ this._aspectContainer.setRatio(...this._currentPage.getRatio());
}
_clearKeyboardRestTimer() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]