-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move gtk.nim into bindings dir * Refactor adwaita bindings into a binding module * Re export bound enums * Add SearchEntry widget * Add Search Entry Widget * Add text field to searchEntry widget * Add missing text hook * Improve search entry example * Further improve example * Refine which fields you shouldn't have access to * Add activity to when you stop a search * Add activity to when you stop a search * Fix search entry displaying weird spacing * Unify GtkMinor into a single constant * Debug change Attempt to cat out the gtk.nim file to see how the hell it is getting the impression that GtkMinor is defined twice. * Move GtkMInor before the passL flag is passed? Maybe this fixes the problem with the pipeline sudenly thinking that value was defined twice. * Unto test-pipeline debug change * Comment out unsupported search thingy * Minor tweaks - Removed searchstring parameter from callbacks - made sure only changed callback can modify search value - Updated example - Moved example to far nicer looking ListBox * Remove unnecessary Box * Update examples/widgets/search_entry.nim Co-authored-by: Can Lehmann <85876381+can-lehmann@users.noreply.github.com> --------- Co-authored-by: Can Lehmann <85876381+can-lehmann@users.noreply.github.com> * Add PasswordEntry widget * Add core of password entry widget * Add bindings for menu model I do not plan to act on them yet but I'd like to at least already add them so I don't have to make the effort later * Update password entry docs * Improve gitignore * Use unsafeAddr for nim version 1.0 * Fix GValue being let instead of var * Add text field to password entry * Ensure activateEventCallback also updates state * Add missing text hook * Add way to demonstrate 2 way binding * Remove unnecessary pragma ping pong * Removed password from activate callback parameters * Add ActionBar widget * Make Centerbox orientable * Add Action Bar Widget and docs * Minor refinement to the action bar example It now actually "deletes" the contents of the label. There's also a button to reset its value. * Improve example button styling * Add examples to .gitignore * Update docs * Add toolbar view widget * Set actionbar revealed default value as in gtk * Add toolbar view to examples ignored by CI * Update docs * Fix merge * Use since pragma * Improve examples --------- Co-authored-by: Can Lehmann <can.l@posteo.de>
- Loading branch information
1 parent
78a9acc
commit 8388233
Showing
7 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 Can Joshua Lehmann | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
import owlkettle, owlkettle/[playground, adw] | ||
|
||
viewable App: | ||
bottomBarStyle: ToolbarStyle = ToolbarRaisedBorder | ||
extendContentToBottomEdge: bool = true | ||
extendContentToTopEdge: bool = true | ||
revealBottomBars: bool = true | ||
revealTopBars: bool = true | ||
topBarStyle: ToolbarStyle = ToolbarRaisedBorder | ||
sensitive: bool = true | ||
tooltip: string = "" | ||
sizeRequest: tuple[x, y: int] = (-1, -1) | ||
|
||
method view(app: AppState): Widget = | ||
result = gui: | ||
Window: | ||
title = "Toolbar View Example" | ||
defaultSize = (500, 300) | ||
|
||
HeaderBar {.addTitlebar.}: | ||
insert(app.toAutoFormMenu(sizeRequest = (400, 250))) {.addRight.} | ||
|
||
ToolbarView: | ||
bottomBarStyle = app.bottomBarStyle | ||
extendContentToBottomEdge = app.extendContentToBottomEdge | ||
extendContentToTopEdge = app.extendContentToTopEdge | ||
revealBottomBars = app.revealBottomBars | ||
revealTopBars = app.revealTopBars | ||
topBarStyle = app.topBarStyle | ||
sensitive = app.sensitive | ||
tooltip = app.tooltip | ||
sizeRequest = app.sizeRequest | ||
|
||
Box: | ||
Box {.hAlign: AlignCenter, vAlign: AlignCenter.}: | ||
orient = OrientY | ||
spacing = 12 | ||
|
||
Label(text = "I am a child of a Toolbar View") | ||
|
||
Button: | ||
text = "Toggle Top" | ||
proc clicked() = | ||
app.revealTopBars = not app.revealTopBars | ||
|
||
Button: | ||
text = "Toggle Bottom" | ||
proc clicked() = | ||
app.revealBottomBars = not app.revealBottomBars | ||
|
||
ActionBar {.addTop.}: | ||
revealed = true | ||
|
||
Label: | ||
text = "Top bar" | ||
|
||
ActionBar {.addBottom.}: | ||
revealed = true | ||
|
||
Label: | ||
text = "Bottom Bar" | ||
|
||
adw.brew(gui(App())) |
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