diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index 816080f49..26a40b33b 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -199,6 +199,19 @@ CPButtonImageOffset = 3.0; [self setButtonType:CPMomentaryPushInButton]; } +#pragma mark - +#pragma mark Control Size + +- (void)setControlSize:(CPControlSize)aControlSize +{ + [super setControlSize:aControlSize]; + [self sizeToControlSize]; + [self setFont:[CPFont systemFontForControlSize:[self controlSize]]]; +} + + +#pragma mark - + // Setting the state /*! Returns a Boolean value indicating whether the button allows a mixed state. diff --git a/AppKit/CPControl.j b/AppKit/CPControl.j index cab43a356..f703180bd 100644 --- a/AppKit/CPControl.j +++ b/AppKit/CPControl.j @@ -198,8 +198,12 @@ var CPControlBlackColor = [CPColor blackColor]; return self; } + +#pragma mark - +#pragma mark Control Size + /*! - Returns the scroller's control size + Returns the control's control size */ - (CPControlSize)controlSize { @@ -207,8 +211,8 @@ var CPControlBlackColor = [CPColor blackColor]; } /*! - Sets the scroller's size. - @param aControlSize the scroller's size + Sets the control's size. + @param aControlSize the control's size */ - (void)setControlSize:(CPControlSize)aControlSize { @@ -223,6 +227,10 @@ var CPControlBlackColor = [CPColor blackColor]; [self setNeedsDisplay:YES]; } +/*! + Gets the current theme state according to the current controlSize. + @return a CPThemeState +*/ - (CPThemeState)controlSizeThemeState { switch(_controlSize) @@ -239,6 +247,29 @@ var CPControlBlackColor = [CPColor blackColor]; } } +/*! + @ignore + Change frame size according to the theme control size theme constraints + Basically for height to min-size. +*/ +- (void)sizeToControlSize +{ + var frameSize = [self frameSize], + minSize = [self currentValueForThemeAttribute:@"min-size"], + maxSize = [self currentValueForThemeAttribute:@"max-size"]; + + if (minSize.width > 0) + frameSize.width = MAX(minSize.width, frameSize.width); + + if (minSize.height > 0) + frameSize.height = minSize.height; + + [super setFrameSize:frameSize]; +} + + +#pragma mark - + /*! Sets the receiver's target action. diff --git a/AppKit/CPDatePicker/CPDatePicker.j b/AppKit/CPDatePicker/CPDatePicker.j index e6a7b08f6..b6fe90963 100644 --- a/AppKit/CPDatePicker/CPDatePicker.j +++ b/AppKit/CPDatePicker/CPDatePicker.j @@ -224,6 +224,16 @@ CPEraDatePickerElementFlag = 0x0100; } +#pragma mark - +#pragma mark Control Size + +- (void)setControlSize:(CPControlSize)aControlSize +{ + [super setControlSize:aControlSize]; + [self sizeToControlSize]; +} + + #pragma mark - #pragma mark Delegate methods @@ -253,16 +263,6 @@ CPEraDatePickerElementFlag = 0x0100; if (_datePickerStyle == CPTextFieldAndStepperDatePickerStyle || _datePickerStyle == CPTextFieldDatePickerStyle) { - var frameSize = [self frameSize], - minSize = [self currentValueForThemeAttribute:@"min-size"]; - - if (minSize.height > 0.0) - { - // Force height - frameSize.height = minSize.height; - [self setFrameSize:frameSize]; - } - [_datePickerTextfield setHidden:NO]; [_datePickerCalendar setHidden:YES]; [_datePickerTextfield setControlSize:[self controlSize]]; diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index ac9140509..dbf1e21c7 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -227,21 +227,19 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); }; } + +#pragma mark - +#pragma mark Control Size + - (void)setControlSize:(CPControlSize)aControlSize { [super setControlSize:aControlSize]; - - var frameSize = [self frameSize], - maxSize = [self currentValueForThemeAttribute:@"max-size"], - font = [self currentValueForThemeAttribute:@"font"]; - - if (maxSize.height > 0) - frameSize.height = maxSize.height; - - [self setFrameSize:frameSize]; + [self sizeToControlSize]; [self setFont:[CPFont systemFontForControlSize:[self controlSize]]]; } +#pragma mark - + #if PLATFORM(DOM) - (DOMElement)_inputElement diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-highlighted.png new file mode 100644 index 000000000..36293c3c3 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed-highlighted.png new file mode 100644 index 000000000..ea057da74 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed.png new file mode 100644 index 000000000..181652e6b Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-mixed.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected-highlighted.png new file mode 100644 index 000000000..f0f4bbe35 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected.png new file mode 100644 index 000000000..5cbf7b678 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image-selected.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-mini-image.png b/AppKit/Themes/Aristo2/Resources/check-box-mini-image.png new file mode 100644 index 000000000..a350385ec Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-mini-image.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image-highlighted.png new file mode 100644 index 000000000..32ee0c4a8 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed-highlighted.png new file mode 100644 index 000000000..ce8ec074a Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed.png new file mode 100644 index 000000000..d1e7f0d55 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image-mixed.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected-highlighted.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected-highlighted.png new file mode 100644 index 000000000..4c2bf9c38 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected-highlighted.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected.png new file mode 100644 index 000000000..9398703f9 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image-selected.png differ diff --git a/AppKit/Themes/Aristo2/Resources/check-box-small-image.png b/AppKit/Themes/Aristo2/Resources/check-box-small-image.png new file mode 100644 index 000000000..ce6c6a373 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/check-box-small-image.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-center.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-center.png new file mode 100644 index 000000000..7f2e681ed Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-center.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-center.png new file mode 100644 index 000000000..0f2e410a9 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-left.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-left.png new file mode 100644 index 000000000..3aaee06f1 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right-pullsdown.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right-pullsdown.png new file mode 100644 index 000000000..8b2594040 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right-pullsdown.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right.png new file mode 100644 index 000000000..dc1067c75 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-disabled-right.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-left.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-left.png new file mode 100644 index 000000000..180d9dc5f Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right-pullsdown.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right-pullsdown.png new file mode 100644 index 000000000..6d20914c0 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right-pullsdown.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right.png new file mode 100644 index 000000000..68c520731 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-mini-right.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-center.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-center.png new file mode 100644 index 000000000..96a161dfa Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-center.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-center.png new file mode 100644 index 000000000..b1a343766 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-center.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-left.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-left.png new file mode 100644 index 000000000..603b9a204 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right-pullsdown.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right-pullsdown.png new file mode 100644 index 000000000..0851dc6e3 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right-pullsdown.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right.png new file mode 100644 index 000000000..722d08fb0 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-disabled-right.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-left.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-left.png new file mode 100644 index 000000000..f551a5957 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-left.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right-pullsdown.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right-pullsdown.png new file mode 100644 index 000000000..9f954b6c6 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right-pullsdown.png differ diff --git a/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right.png b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right.png new file mode 100644 index 000000000..868eedb60 Binary files /dev/null and b/AppKit/Themes/Aristo2/Resources/popup-bezel-small-right.png differ