Skip to content

Commit 039cb6c

Browse files
committed
Added Border Radius (Corner Radius) option to Settings > Window menu carbon-app#1412
1 parent d6b40a3 commit 039cb6c

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

components/Carbon.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ class Carbon extends React.PureComponent {
314314
min-width: inherit;
315315
position: relative;
316316
z-index: 1;
317-
border-radius: 5px;
317+
${config.borderRadius
318+
? `border-radius: ${config.borderRadius};`
319+
: 'border-radius: 5px'};
318320
${config.dropShadow
319321
? `box-shadow: 0 ${config.dropShadowOffsetY} ${config.dropShadowBlurRadius} rgba(0, 0, 0, 0.55)`
320322
: ''};
@@ -325,7 +327,10 @@ class Carbon extends React.PureComponent {
325327
min-width: inherit;
326328
padding: 18px 18px;
327329
padding-left: 12px;
328-
${config.lineNumbers ? 'padding-left: 12px;' : ''} border-radius: 5px;
330+
${config.lineNumbers ? 'padding-left: 12px;' : ''}
331+
${config.borderRadius
332+
? `border-radius: ${config.borderRadius};`
333+
: 'border-radius: 5px'};
329334
font-family: ${config.fontFamily}, monospace !important;
330335
font-size: ${config.fontSize};
331336
line-height: ${config.lineHeight};

components/Settings.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function KeyboardShortcut({ trigger, handle }) {
2323
function WindowSettings({
2424
onChange,
2525
windowTheme,
26+
borderRadius,
2627
paddingHorizontal,
2728
paddingVertical,
2829
dropShadow,
@@ -42,6 +43,14 @@ function WindowSettings({
4243
windowControls={windowControls}
4344
onChange={onChange}
4445
/>
46+
<Slider
47+
label="Corner Radius"
48+
value={borderRadius}
49+
minValue={0}
50+
maxValue={25}
51+
onChange={onChange.bind(null, 'borderRadius')}
52+
/>
53+
4554
<div className="row">
4655
<Slider
4756
label="Padding (vert)"
@@ -375,6 +384,7 @@ class Settings extends React.PureComponent {
375384
onWidthChanging={this.handleWidthChanging}
376385
onWidthChanged={this.handleWidthChanged}
377386
windowTheme={this.props.windowTheme}
387+
borderRadius={this.props.borderRadius}
378388
paddingHorizontal={this.props.paddingHorizontal}
379389
paddingVertical={this.props.paddingVertical}
380390
dropShadow={this.props.dropShadow}

lib/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ export const DEFAULT_SETTINGS = {
10931093
backgroundImageSelection: null,
10941094
backgroundMode: 'color',
10951095
backgroundColor: DEFAULT_BG_COLOR,
1096+
borderRadius: '5px',
10961097
dropShadow: true,
10971098
dropShadowOffsetY: '20px',
10981099
dropShadowBlurRadius: '68px',

0 commit comments

Comments
 (0)