-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
111 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Apart from the very limited "place" the main purpose of this | ||
# class is to ensure there *always* is a layout | ||
# | ||
class FloatingLayout | ||
|
||
def initialize(rootgeom) | ||
@rootgeom = rootgeom | ||
end | ||
|
||
def find(w) = nil | ||
|
||
def place(w, focus) | ||
attr = w.get_geometry | ||
return if attr.is_a?(X11::Form::Error) | ||
x = attr.x | ||
y = attr.y | ||
width = attr.width | ||
height = attr.height | ||
width = @rootgeom.width / 2 if width < 10 | ||
height = @rootgeom.height - 100 if height < 10 | ||
x = (@rootgeom.width - width) /2 if x == 0 | ||
y = (@rootgeom.height - height)/2 if y == 0 | ||
w.configure(x:, y:, width:, height:) | ||
end | ||
|
||
def call = nil | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters