Skip to content

Commit

Permalink
Merge b816cf9 into df6ca42
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiedt committed May 19, 2020
2 parents df6ca42 + b816cf9 commit 8ca9603
Show file tree
Hide file tree
Showing 656 changed files with 2,033 additions and 1,378 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Metacello new
```

### Fonts
Copy all `*.ttf` files from [this folder](https://github.com/hpi-swa-teaching/MaterialDesignWidgets/tree/master/build-support/fonts) to `/path/to/Squeak-Image/Contents/Resources/Roboto`.
Copy all `*.ttf` files from [this folder](https://github.com/hpi-swa-teaching/MaterialDesignWidgets/tree/master/build-support/fonts) to `/pathToSqueak-Image/Contents/Resources/Roboto`.
> The import is only executed multiple times if something went wrong during the import.
> To manually force a new import execute `MDWidget fontsImported: false`
# Contributors
Carolin Goerke, Max Plaga, Jan Westphal, Lasse Steffen, Mats Pörschke
## Useful Information for Developers
Please have a look at our [coding standards](https://github.com/hpi-swa-teaching/MaterialDesignWidgets/wiki/Coding-Standards) in the [wiki](https://github.com/hpi-swa-teaching/MaterialDesignWidgets/wiki)

## Contributors
- Team 1: Carolin Goerke, Max Plaga, Jan Westphal, Lasse Steffen, Mats Pörschke
- Team 2: Wanda Baltzer, Antonius Naumann, Luc Prestin, Robin Wersich
2 changes: 2 additions & 0 deletions packages/Material-Core.package/MDAppBar.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A MDAppBar is part of the Material Design toolbar. It contains a label and a menu button.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties
defaultBackgroundColor

^ MDColorTheme currentTheme primaryColor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
components
addLabel: aLabel

self addMorphBack: aLabel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
components
addMenuControl: aMenuControl

self addMorphBack: aMenuControl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
initialization
initialize

super initialize.
self
vResizing: #spaceFill;
backgroundColor: self class defaultBackgroundColor;
addDropShadow
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"class" : {
"defaultBackgroundColor" : "wb 7/11/2019 14:03" },
"instance" : {
"addLabel:" : "wb 7/11/2019 14:49",
"addMenuControl:" : "wb 7/11/2019 14:47",
"initialize" : "wb 7/12/2019 15:16" } }
14 changes: 14 additions & 0 deletions packages/Material-Core.package/MDAppBar.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "Material-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "wb 7/24/2019 16:28",
"instvars" : [
],
"name" : "MDAppBar",
"pools" : [
],
"super" : "MDWidget",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
alwaysUppercase

^ true

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties
defaultBackgroundColor

^ MDColorTheme currentTheme secondaryColor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties
defaultBackgroundColorToggled

^ MDColorTheme currentTheme secondaryColorDarkest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultBorderRadius

^ 2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultElevatedSizeDifference

^ 1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultHeight

^ 36
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultIconPadding

^ 12
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultIconSize

^ 18
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultIconTextPadding

^ 8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultPadding

^ 16
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultShadowScaler

^ 1.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultText

^ 'BUTTON'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
defaultTextColor

^ '#FFFFFF'
^ MDColorTheme currentTheme textColorOn: self defaultBackgroundColor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties
defaultTextColorToggled

^ MDColorTheme currentTheme textColorOn: self defaultBackgroundColorToggled
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
minWidth

^ 64
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties
minimumPadding

^ 5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default properties
properties
textDisabledAlpha

^ 0.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
backgroundColorToggled: aValue

| value |

value := self setProperty: #backgroundColorToggled to: (self colorFrom: aValue).

^ value
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
backgroundColorToggled

^ self properties at: #backgroundColorToggled ifAbsent: [^ self backgroundColorToggled: self class defaultBackgroundColorToggled]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
drawing
calculateWidthByText

(self icon isNil and: self iconRight isNil)
| width |

(self icon isNil and: [self iconRight isNil])
ifTrue: [^ self label width + (2 * self class defaultPadding)]
ifFalse: [
| width |

ifFalse: [
self icon
ifNil: [width := self class defaultPadding]
ifNotNil: [width := self class defaultIconPadding + self class defaultIconSize + self class defaultIconTextPadding].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
drawing
checkToggled

(self isEnabled and: self isToggled) ifTrue: [
self currentBackgroundColor: self class backgroundColorToggled]
self isEnabled ifTrue: [
(self isToggled)
ifTrue: [
self currentBackgroundColor: self backgroundColorToggled.
self currentTextColor: self textColorToggled]
ifFalse: [
self currentBackgroundColor: self backgroundColor.
self currentTextColor: self textColor]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
currentTextColor: aColor

self label color: aColor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
currentTextColor

^ self label color
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ handlesMouseOver: anEvent

self isToggled ifTrue: [^ false].

^ super handlesMouseDown: anEvent
^ super handlesMouseOver: anEvent
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ accessing
label: anObject

anObject isString
ifTrue: [self text: anObject]
ifTrue: [self labelContents: anObject]
ifFalse: [label := anObject]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
labelContents: anObject

self label contents: anObject.
self updateBounds.

^ anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
drawing
labelShrinkThreshold

^ (self label font widthOf: $m) * 2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ accessing
textColor: aValue

| value |

value := self setProperty: #textColor to: (self colorFrom: aValue).
self label color: self textColor.

^ value
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
textColorDisabled

^ (self class gray: self backgroundColor) alpha: self class textDisabledAlpha
^ (self class gray: self textColor) alpha: self class textDisabledAlpha
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
textColorToggled: aValue

| value |

value := self setProperty: #textColorToggled to: (self colorFrom: aValue).

^ value
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
textColorToggled

^ self properties at: #textColorToggled ifAbsent: [^ self textColorToggled: self class defaultTextColorToggled]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
event handling
toggleOn

self isDisabled ifTrue: [^ false].
self isDisabled ifTrue: [^ self].
self toggled: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
drawing
updateContents: aCanvas

self updateLabelPosition.
self updateIcons
self updateIcons.
self updateLabelExtent.
self updateLabelPosition
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
drawing
updateLabelExtent

| availableWidth |

availableWidth := self width.
self hasIcon ifTrue: [availableWidth := availableWidth - self icon width].
self hasIconRight ifTrue: [availableWidth := availableWidth - self iconRight width].
availableWidth := availableWidth - (self class minimumPadding * 2).

availableWidth < self labelShrinkThreshold
ifTrue: [self label shrink]
ifFalse: [
self label expand.
availableWidth < self label fullWidth
ifTrue: [self label width: availableWidth]]
Loading

0 comments on commit 8ca9603

Please sign in to comment.