Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1261.mcz ==================== Summary ==================== Name: Morphic-mt.1261 Author: mt Time: 11 August 2016, 7:34:35.866369 pm UUID: 8dc6212e-7cad-3149-a3ca-26faef7e0ecf Ancestors: Morphic-mt.1260 Make radio buttons, check boxes, sub-menu markers theme-able. =============== Diff against Morphic-mt.1260 =============== Item was added: + ----- Method: MenuIcons class>>checkBoxOff (in category 'accessing - icons') ----- + checkBoxOff + + ^ Icons + at: #'checkBoxOff' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295) + offset: 0@0) ].! Item was added: + ----- Method: MenuIcons class>>checkBoxOffColorized: (in category 'accessing - icons') ----- + checkBoxOffColorized: aColor + + ^ self checkBoxOff + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>checkBoxOn (in category 'accessing - icons') ----- + checkBoxOn + + ^ Icons + at: #'checkBoxOn' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295) + offset: 0@0) ].! Item was added: + ----- Method: MenuIcons class>>checkBoxOnColorized: (in category 'accessing - icons') ----- + checkBoxOnColorized: aColor + + ^ self checkBoxOn + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>checkBoxPressed (in category 'accessing - icons') ----- + checkBoxPressed + + ^ Icons + at: #'checkBoxPressed' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295) + offset: 0@0) ].! Item was added: + ----- Method: MenuIcons class>>checkBoxPressedColorized: (in category 'accessing - icons') ----- + checkBoxPressedColorized: aColor + + ^ self checkBoxPressed + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>radioButtonOff (in category 'accessing - icons') ----- + radioButtonOff + + ^ Icons + at: #'radioButtonOff' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 4294967295 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0) + offset: 0@0)].! Item was added: + ----- Method: MenuIcons class>>radioButtonOffColorized: (in category 'accessing - icons') ----- + radioButtonOffColorized: aColor + + ^ self radioButtonOff + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>radioButtonOn (in category 'accessing - icons') ----- + radioButtonOn + + ^ Icons + at: #'radioButtonOn' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 4294967295 0 0 0 4294967295 4294967295 4294967295 4294967295 0 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 0 4294967295 4294967295 4294967295 4294967295 0 0 0 4294967295 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0) + offset: 0@0)].! Item was added: + ----- Method: MenuIcons class>>radioButtonOnColorized: (in category 'accessing - icons') ----- + radioButtonOnColorized: aColor + + ^ self radioButtonOn + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>radioButtonPressed (in category 'accessing - icons') ----- + radioButtonPressed + + ^ Icons + at: #'radioButtonPressed' + ifAbsentPut:[ (Form + extent: 12@12 + depth: 32 + fromArray: #( 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 4294967295 0 0 0 4294967295 4294967295 4294967295 4294967295 0 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 4294967295 0 0 0 0 4294967295 0 0 4294967295 4294967295 0 0 0 4294967295 4294967295 4294967295 4294967295 0 0 0 4294967295 0 4294967295 0 0 0 0 0 0 0 0 4294967295 0 0 0 4294967295 0 0 0 0 0 0 4294967295 0 0 0 0 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 0 0) + offset: 0@0)].! Item was added: + ----- Method: MenuIcons class>>radioButtonPressedColorized: (in category 'accessing - icons') ----- + radioButtonPressedColorized: aColor + + ^ self radioButtonPressed + collectColors: [:c | aColor alpha: c alpha]! Item was added: + ----- Method: MenuIcons class>>subMenuMarker (in category 'accessing - icons') ----- + subMenuMarker + + ^ Icons + at: #'subMenuMarker' + ifAbsentPut:[ (Form + extent: 5@9 + depth: 32 + fromArray: #( 4294967295 0 0 0 0 4294967295 4294967295 0 0 0 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 4294967295 4294967295 0 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 0 4294967295 4294967295 4294967295 0 0 4294967295 4294967295 0 0 0 4294967295 0 0 0 0) + offset: 0@0)].! Item was added: + ----- Method: MenuIcons class>>subMenuMarkerColorized: (in category 'accessing - icons') ----- + subMenuMarkerColorized: aColor + + ^ self subMenuMarker + collectColors: [:c | aColor alpha: c alpha]! Item was changed: ----- Method: MenuItemMorph class>>applyUserInterfaceTheme (in category 'preferences') ----- applyUserInterfaceTheme + SubMenuMarker := self defaultSubMenuMarker.! - SubMenuMarker := (UserInterfaceTheme current get: #subMenuMarker for: self) - ifNil: [self defaultSubMenuMarker].! Item was changed: ----- Method: MenuItemMorph class>>defaultSubMenuMarker (in category 'defaults') ----- defaultSubMenuMarker + ^ MenuIcons subMenuMarkerColorized: ((UserInterfaceTheme current get: #textColor for: self) ifNil: [Color black]).! - | f | - f := Form - extent: 5@9 - fromArray: #(2147483648 3221225472 3758096384 4026531840 4160749568 4026531840 3758096384 3221225472 2147483648) - offset: 0@0. - ^ ColorForm mappingWhiteToTransparentFrom: f! Item was changed: ----- Method: MenuItemMorph class>>themeProperties (in category 'preferences') ----- themeProperties ^ super themeProperties, { { #font. 'Fonts'. 'Font for menu items.' }. { #textColor. 'Colors'. 'Color for the menu item''s labels.' }. { #disabledTextColor. 'Colors'. 'Color to use for disabled menu item labels.' }. { #selectionColor. 'Colors'. 'Color used for items when hovering or selecting them.' }. { #selectionTextColor. 'Colors'. 'Color used for label when hovering or selecting them.' }. - { #subMenuMarker. 'Forms'. 'The form to be used to indicate a submenu.' }. }! Item was changed: ----- Method: MenuItemMorph>>offImage (in category 'private') ----- offImage "Return the form to be used for indicating an '<off>' marker" + + ^ MenuIcons checkBoxOffColorized: (self userInterfaceTheme textColor ifNil: [Color black])! - | form | - form := Form extent: (self fontToUse ascent-2) asPoint depth: 16. - (form getCanvas) - frameAndFillRectangle: form boundingBox fillColor: (Color gray: 0.9) - borderWidth: 1 borderColor: Color black. - ^form! Item was changed: ----- Method: MenuItemMorph>>onImage (in category 'private') ----- onImage + "Return the form to be used for indicating an '<on>' marker" + + ^ MenuIcons checkBoxOnColorized: (self userInterfaceTheme textColor ifNil: [Color black])! - "Return the form to be used for indicating an '<off>' marker" - | form | - form := Form extent: (self fontToUse ascent-2) asPoint depth: 16. - (form getCanvas) - frameAndFillRectangle: form boundingBox fillColor: (Color gray: 0.8) - borderWidth: 1 borderColor: Color black; - fillRectangle: (form boundingBox insetBy: 2) fillStyle: Color black. - ^form! Item was changed: ----- Method: ThreePhaseButtonMorph class>>checkBox (in category 'instance creation') ----- checkBox "Answer a button pre-initialized with checkbox images." | f | ^self new + onImage: (f := MenuIcons checkBoxOnColorized: Color red); + pressedImage: (MenuIcons checkBoxPressedColorized: Color black); + offImage: (MenuIcons checkBoxOffColorized: Color black); - onImage: (f := ScriptingSystem formAtKey: 'CheckBoxOn'); - pressedImage: (ScriptingSystem formAtKey: 'CheckBoxPressed'); - offImage: (ScriptingSystem formAtKey: 'CheckBoxOff'); extent: f extent + (2@0); setDefaultParameters; yourself ! Item was changed: ----- Method: ThreePhaseButtonMorph class>>radioButton (in category 'instance creation') ----- radioButton "Answer a button pre-initialized with radiobutton images." | f | ^self new + onImage: (f := MenuIcons radioButtonOnColorized: Color black); + pressedImage: (MenuIcons radioButtonPressedColorized: Color black); + offImage: (MenuIcons radioButtonOffColorized: Color black); - onImage: (f := ScriptingSystem formAtKey: 'RadioButtonOn'); - pressedImage: (ScriptingSystem formAtKey: 'RadioButtonPressed'); - offImage: (ScriptingSystem formAtKey: 'RadioButtonOff'); extent: f extent + (2@0); setDefaultParameters; yourself ! |
Free forum by Nabble | Edit this page |