Skip to content

Commit

Permalink
Fix BaselinePosition naming
Browse files Browse the repository at this point in the history
  • Loading branch information
can-lehmann committed Oct 14, 2023
1 parent 8d3aee7 commit 6ae5ae8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
25 changes: 24 additions & 1 deletion docs/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ renderable CenterBox of BaseWidget
- `startWidget: Widget`
- `centerWidget: Widget`
- `endWidget: Widget`
- `baselinePosition: BaselinePosition = center`
- `baselinePosition: BaselinePosition = BaselineCenter`
- `shrinkCenterLast: bool = false` Requires GTK 4.12 or higher to work. Compile with `-d:gtkminor=12` to enable it

###### Adders
Expand Down Expand Up @@ -1563,3 +1563,26 @@ A progress bar widget to show progress being made on a long-lasting task
- `text: string = ""`


## ListView

```nim
renderable ListView of BaseWidget
```

###### Fields

- All fields from [BaseWidget](#BaseWidget)
- `size: int` Number of items
- `selectionMode: SelectionMode`
- `selected: HashSet[int]` Indices of the currently selected items.
- `showSeparators: bool = false`
- `singleClickActivate: bool = false`
- `enableRubberband: bool = false`

###### Events

- viewItem: `proc (index: int): Widget`
- select: `proc (rows: HashSet[int])`
- activate: `proc (index: int)`


3 changes: 2 additions & 1 deletion examples/widgets/center_box.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import std/[sequtils]
import owlkettle, owlkettle/[dataentries, playground, adw]

viewable App:
baselinePosition: BaselinePosition = center
baselinePosition: BaselinePosition = BaselineCenter
shrinkCenterLast: bool = false
addStartWidget: bool = true
addEndWidget: bool = true
Expand Down Expand Up @@ -55,4 +55,5 @@ method view(app: AppState): Widget =

if app.addEndWidget:
Label(text = "End of CenterBox") {.addEnd.}

adw.brew(gui(App()))
2 changes: 1 addition & 1 deletion owlkettle/widgets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ renderable CenterBox of BaseWidget:
startWidget: Widget
centerWidget: Widget
endWidget: Widget
baselinePosition: BaselinePosition = center
baselinePosition: BaselinePosition = BaselineCenter
shrinkCenterLast: bool = false ## Requires GTK 4.12 or higher to work. Compile with `-d:gtkminor=12` to enable it

hooks:
Expand Down

0 comments on commit 6ae5ae8

Please sign in to comment.