Skip to content

Commit

Permalink
Add example for toggles with icons and labels
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed May 15, 2024
1 parent 49254fd commit 95a7b8a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #BrDateAndTimeSinceNowPrinter }

{ #category : #'*Brick-Examples' }
BrDateAndTimeSinceNowPrinter classSide >> gtDemoFor: aView [
BrDateAndTimeSinceNowPrinter class >> gtDemoFor: aView [
<gtClassView>
^ aView forward
title: 'Demo';
Expand Down
22 changes: 21 additions & 1 deletion src/Brick-Examples/BrGlamorousComponentsToggles.class.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #BrGlamorousComponentsToggles,
#superclass : #BrGlamorousComponents,
#category : 'Brick-Examples-! Glamorous components'
#category : #'Brick-Examples-! Glamorous components'
}

{ #category : #accessing }
Expand All @@ -24,6 +24,26 @@ BrGlamorousComponentsToggles >> toggleGroupWithIcons [
label: 'Play')
]

{ #category : #accessing }
BrGlamorousComponentsToggles >> toggleGroupWithIconsAndLabels [
<gtExample>

^ BrToggleGroup new
aptitude: BrGlamorousToggleGroupAptitude new;
addToggle: (BrToggle new
aptitude: BrGlamorousToggleWithIconAndLabelAptitude new;
icon: BrGlamorousVectorIcons inspect;
label: 'Inspect');
addToggle: (BrToggle new
aptitude: BrGlamorousToggleWithIconAndLabelAptitude new;
icon: BrGlamorousVectorIcons browse;
label: 'Browse');
addToggle: (BrToggle new
aptitude: BrGlamorousToggleWithIconAndLabelAptitude new;
icon: BrGlamorousVectorIcons play;
label: 'Play')
]

{ #category : #accessing }
BrGlamorousComponentsToggles >> toggleGroupWithLabels [
<gtExample>
Expand Down
7 changes: 6 additions & 1 deletion src/Brick/BrToggleGroup.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ Class {
#superclass : #BlElement,
#traits : 'TBrLayoutResizable',
#classTraits : 'TBrLayoutResizable classTrait',
#category : 'Brick-Toggle - UI'
#category : #'Brick-Toggle - UI'
}

{ #category : #accessing }
BrToggleGroup >> activatedToggle [
^ self viewModel activatedToggle widget
]

{ #category : #'adding / removing' }
BrToggleGroup >> addToggle: aToggle [
self viewModel addToggle: aToggle viewModel.
Expand Down

0 comments on commit 95a7b8a

Please sign in to comment.