-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* debug attempt * #83 Add first attempt at scale widget * #83 Fix types on bindings double in C translates to cdouble in nim, not cfloat. * #83 improve examples and implementation * stuff * #83 Add support for initial widget value * #83 Add support for inverting widget * #83 fix some bugs * #83 add update of ScaleState to change proc * #83 let pageSize just default to double the pageSize * #83 add support for showing or hiding fill level and precision * #83 Fix bug causing infinite window growth * #83 refactor state-variables to use property hooks * #83 implement suggestion for value 2way bindings * #83 Fix example * #83 Add support for configuring value position * #83 Make orientation configurable * #83 Fix example datatype (this was int but needs to be float64) * #83 Fix semantics on marks * #83 Ensure order of hooks is the same as order of properties * #83 Add build hook to make initial value assignment work again * #83 slightly beautify example * #83 Adjust proc-calling to code conventions * #83 Add widgets example * ##83 add doc comments to Scale widget * #83 Update widgets.md * Add notice that there's a nimble task to generate docs as well * #83 Remove nonsense workflow change * #83 Add scale to example README and mild improvements * Remove nonsense workflow change from myself * #83 Mild doc comment improvements * #83 Fix error introduced by last commit in doc comments * #83 Remove build hook * #83 Move float64 to float * #83 Minor doc update * #83 Improve Scale example to make it more configurable * #93 Add AutoForm function Generates a Box widget with editable dataentry widgets for each field on the state. You can exclude certain fields as desired. * #93 Minor Fix to Scale Widget example * #93 add support for DateTime with Calendar widget * #93 Add ability to deal with tuples generally * #93 add basewidget fields * Improve example * Fix Text View example image width * Update gitignore * #93 Update Autoform for scale * debug attempt * Remove nonsense workflow change from myself * #93 Add BaseWidget attributes back to example * #93 Add an auto mini form generator * #93 Add nicer form fields specifically for sizeRequest tuple * #93 Fully move over to the non-form-generating approach * #85 Add Expander Widget including example * #85 Add BaseWidget fields * #85 Add example to README.md * #85 add Activation callback and doc comments * #85 Update and expand docs * #85 Fix expander callback delivering outdated values * #85 Move expander example over to autoform * #85 Update docs and example screenshot * #85 Refine example and remove autoform * #85 Update widgets.md The introduction of gtkminor in an earlier PR changed this doc comment. That caused a change in widgets.md * Update owlkettle/widgets.nim Co-authored-by: Can Lehmann <85876381+can-lehmann@users.noreply.github.com> * #85 Move Expander to make sure list is sorted alphabetically * #85 Update docs --------- Co-authored-by: Can Lehmann <can.l@posteo.de> Co-authored-by: Can Lehmann <85876381+can-lehmann@users.noreply.github.com>
- Loading branch information
1 parent
6b0c75e
commit c3aacd3
Showing
6 changed files
with
205 additions
and
3 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,82 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2023 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/[adw, playground] | ||
|
||
viewable App: | ||
label: string = "A String Label" | ||
expanded: bool = false | ||
resizeToplevel: bool = false | ||
useMarkup: bool = false | ||
useUnderline: bool = false | ||
sensitive: bool = true | ||
sizeRequest: tuple[x, y: int] = (-1, -1) | ||
tooltip: string = "" | ||
|
||
|
||
method view(app: AppState): Widget = | ||
result = gui: | ||
Window(): | ||
defaultSize = (800, 600) | ||
title = "Expander Example" | ||
HeaderBar {.addTitlebar.}: | ||
insert(app.toAutoFormMenu(sizeRequest = (400, 520))) {.addRight.} | ||
|
||
Box(orient = OrientY, spacing = 6, margin = 12): | ||
Label(): | ||
useMarkup = true | ||
text = """<span size="x-large" weight="bold"> Expander with String Label </span>""" | ||
|
||
Expander(): | ||
label = app.label | ||
expanded = app.expanded | ||
resizeTopLevel = app.resizeTopLevel | ||
useMarkup = app.useMarkup | ||
useUnderline = app.useUnderline | ||
sensitive = app.sensitive | ||
sizeRequest = app.sizeRequest | ||
tooltip = app.tooltip | ||
|
||
proc activate(activated: bool) = | ||
app.expanded = activated | ||
|
||
Label(text = "I am a child widget inserted into the Expander") | ||
|
||
Separator() {.expand: false.} | ||
|
||
Label(): | ||
useMarkup = true | ||
text = """<span size="x-large" weight="bold"> Expander with Widget Label </span>""" | ||
|
||
Expander(): | ||
expanded = app.expanded | ||
resizeTopLevel = app.resizeTopLevel | ||
useMarkup = app.useMarkup | ||
useUnderline = app.useUnderline | ||
|
||
proc activate(activated: bool) = | ||
app.expanded = activated | ||
|
||
Label(text = "A Widget Label") {.addLabel.} | ||
Label(text = "I am a child widget inserted into the Expander") | ||
|
||
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