mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
55 lines
1.1 KiB
Smalltalk
55 lines
1.1 KiB
Smalltalk
Class {
|
|
#name : #DiyaUIThemesManager,
|
|
#superclass : #DiyaSingleton,
|
|
#instVars : [
|
|
'themes',
|
|
'currentThemeName'
|
|
],
|
|
#category : #'Diya-UIThemes'
|
|
}
|
|
|
|
{ #category : #adding }
|
|
DiyaUIThemesManager >> addTheme:name stylesheet:sheet [
|
|
themes at:name put: sheet
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
DiyaUIThemesManager >> currentTheme [
|
|
^ themes at: self currentThemeName ifAbsent: [
|
|
DiyaCoreAPIError signal: 'Undefined theme named', self currentThemeName
|
|
]
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
DiyaUIThemesManager >> currentThemeName [
|
|
^ currentThemeName
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
DiyaUIThemesManager >> currentThemeName: anObject [
|
|
currentThemeName := anObject
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaUIThemesManager >> defaultTheme [
|
|
^ themes at: #default
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaUIThemesManager >> defineDefaultTheme [
|
|
self addTheme: #default stylesheet: DiyaDefaultTheme new.
|
|
]
|
|
|
|
{ #category : #initialization }
|
|
DiyaUIThemesManager >> initialize [
|
|
super initialize.
|
|
themes := Dictionary new.
|
|
self defineDefaultTheme.
|
|
self currentThemeName: #default.
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
DiyaUIThemesManager >> themes [
|
|
^ themes
|
|
]
|