git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72fca17
)
Only allow keyboard resizing when RESIZABLE is set
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Sat, 29 Jul 2017 01:17:55 +0000
(21:17 -0400)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Sat, 29 Jul 2017 01:17:55 +0000
(21:17 -0400)
src/jexer/TWindow.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jexer/TWindow.java
b/src/jexer/TWindow.java
index 6cd11e5982fface1b1b8a44a29000c6cb8ddb794..8749eb86cd1b46f4d41db781400d688cc4aba9de 100644
(file)
--- a/
src/jexer/TWindow.java
+++ b/
src/jexer/TWindow.java
@@
-989,38
+989,46
@@
public class TWindow extends TWidget {
setY(getY() - 1);
}
}
setY(getY() - 1);
}
}
- if (keypress.equals(kbShiftLeft)) {
- if ((getWidth() > minimumWindowWidth)
- || (minimumWindowWidth <= 0)
- ) {
- setWidth(getWidth() - 1);
+
+ /*
+ * Only permit keyboard resizing if the window was RESIZABLE.
+ */
+ if ((flags & RESIZABLE) != 0) {
+
+ if (keypress.equals(kbShiftLeft)) {
+ if ((getWidth() > minimumWindowWidth)
+ || (minimumWindowWidth <= 0)
+ ) {
+ setWidth(getWidth() - 1);
+ }
}
}
- }
- if (keypress.equals(kbShiftRight)) {
-
if ((getWidth() < maximumWindowWidth
)
- || (maximumWindowWidth <= 0)
- ) {
- setWidth(getWidth() + 1);
+ if (keypress.equals(kbShiftRight)) {
+ if ((getWidth() < maximumWindowWidth)
+
|| (maximumWindowWidth <= 0
)
+ ) {
+ setWidth(getWidth() + 1);
+ }
}
}
- }
- if (keypress.equals(kbShiftUp)) {
-
if ((getHeight() > minimumWindowHeight
)
- || (minimumWindowHeight <= 0)
- ) {
- setHeight(getHeight() - 1);
+ if (keypress.equals(kbShiftUp)) {
+ if ((getHeight() > minimumWindowHeight)
+
|| (minimumWindowHeight <= 0
)
+ ) {
+ setHeight(getHeight() - 1);
+ }
}
}
- }
- if (keypress.equals(kbShiftDown)) {
-
if ((getHeight() < maximumWindowHeight
)
- || (maximumWindowHeight <= 0)
- ) {
- setHeight(getHeight() + 1);
+ if (keypress.equals(kbShiftDown)) {
+ if ((getHeight() < maximumWindowHeight)
+
|| (maximumWindowHeight <= 0
)
+ ) {
+ setHeight(getHeight() + 1);
+ }
}
}
- }
- // Pass a resize event to my children
- onResize(new TResizeEvent(TResizeEvent.Type.WIDGET,
- getWidth(), getHeight()));
+ // Pass a resize event to my children
+ onResize(new TResizeEvent(TResizeEvent.Type.WIDGET,
+ getWidth(), getHeight()));
+
+ } // if ((flags & RESIZABLE) != 0)
return;
}
return;
}