diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-02-10 12:29:03 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-02-10 13:08:27 +0100 |
| commit | 6784cbf74e5dcab20e4eae0a6730d9f73178a085 (patch) | |
| tree | ac366cecbedf1b5053f1388f23a62c4b5e2e10d9 /gui/src/renderer/components/AppButton.tsx | |
| parent | 8f2b7f644b9634c74df9362be4605652c7ccdfe8 (diff) | |
| download | mullvadvpn-6784cbf74e5dcab20e4eae0a6730d9f73178a085.tar.xz mullvadvpn-6784cbf74e5dcab20e4eae0a6730d9f73178a085.zip | |
Improve appearance of reconnect button
Diffstat (limited to 'gui/src/renderer/components/AppButton.tsx')
| -rw-r--r-- | gui/src/renderer/components/AppButton.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gui/src/renderer/components/AppButton.tsx b/gui/src/renderer/components/AppButton.tsx index 6f14fd16e9..212e5cb1a3 100644 --- a/gui/src/renderer/components/AppButton.tsx +++ b/gui/src/renderer/components/AppButton.tsx @@ -73,9 +73,10 @@ export class Icon extends Component<IIconProps> { interface IProps { children?: React.ReactNode; - style?: Types.ButtonStyleRuleSet; + style?: Types.StyleRuleSetRecursive<Types.ButtonStyleRuleSet>; disabled?: boolean; onPress?: () => void; + textOffset?: number; } interface IState { @@ -139,6 +140,7 @@ class BaseButton extends Component<IProps, IState> { } private async updateTextAdjustment(containerLayout: Types.LayoutInfo) { + const textOffset = this.props.textOffset || 0; const labelView = this.textViewRef.current; if (labelView) { @@ -149,7 +151,7 @@ class BaseButton extends Component<IProps, IState> { const trailingSpace = containerLayout.width - (labelLayout.x + labelLayout.width); // calculate text adjustment - const textAdjustment = labelLayout.x - trailingSpace; + const textAdjustment = labelLayout.x - trailingSpace - textOffset; // re-render the view with the new text adjustment if it changed if (this.state.textAdjustment !== textAdjustment) { |
