|
295 | 295 | </SplitButton.IsEnabled> |
296 | 296 | <SplitButton.Flyout> |
297 | 297 | <MenuFlyout> |
298 | | - <MenuItem Header="{DynamicResource Text.WorkingCopy.CommitToEdit}" Command="{Binding Commit}"/> |
| 298 | + <MenuItem Header="{DynamicResource Text.WorkingCopy.CommitToEdit}" |
| 299 | + Command="{Binding Commit}" |
| 300 | + IsEnabled="{Binding CommitMessage, Converter={x:Static c:StringConverters.IsNotNullOrWhitespace}}"/> |
299 | 301 | </MenuFlyout> |
300 | 302 | </SplitButton.Flyout> |
301 | 303 | </SplitButton> |
|
309 | 311 | Command="{Binding Commit}" |
310 | 312 | HotKey="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}" |
311 | 313 | IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNull}}" |
312 | | - IsEnabled="{Binding !IsCommitting}" |
313 | 314 | ToolTip.Placement="Top" |
314 | 315 | ToolTip.VerticalOffset="0"> |
315 | 316 | <ToolTip.Tip> |
|
324 | 325 | </TextBlock> |
325 | 326 | </StackPanel> |
326 | 327 | </ToolTip.Tip> |
| 328 | + |
| 329 | + <Button.IsEnabled> |
| 330 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 331 | + <Binding Path="IsCommitting" Converter="{x:Static BoolConverters.Not}"/> |
| 332 | + <Binding Path="CommitMessage" Converter="{x:Static c:StringConverters.IsNotNullOrWhitespace}"/> |
| 333 | + </MultiBinding> |
| 334 | + </Button.IsEnabled> |
327 | 335 | </Button> |
328 | 336 |
|
329 | 337 | <!-- Invisible button just to add another hotkey `Ctrl+Shift+Enter` to commit with auto-stage --> |
330 | 338 | <Button Grid.Column="7" |
331 | 339 | Width="0" Height="0" |
332 | 340 | Background="Transparent" |
333 | 341 | Command="{Binding CommitWithAutoStage}" |
334 | | - HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}" |
335 | | - IsEnabled="{Binding !IsCommitting}"/> |
| 342 | + HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"> |
| 343 | + <Button.IsEnabled> |
| 344 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 345 | + <Binding Path="IsCommitting" Converter="{x:Static BoolConverters.Not}"/> |
| 346 | + <Binding Path="CommitMessage" Converter="{x:Static c:StringConverters.IsNotNullOrWhitespace}"/> |
| 347 | + </MultiBinding> |
| 348 | + </Button.IsEnabled> |
| 349 | + </Button> |
336 | 350 |
|
337 | 351 | <Button Grid.Column="8" |
338 | 352 | Classes="flat" |
|
342 | 356 | Padding="8,0" |
343 | 357 | Command="{Binding CommitWithPush}" |
344 | 358 | HotKey="Alt+Enter" |
345 | | - IsEnabled="{Binding !IsCommitting}" |
346 | 359 | ToolTip.Tip="{OnPlatform Alt+Enter, macOS=⌥+Enter}" |
347 | 360 | ToolTip.Placement="Top" |
348 | 361 | ToolTip.VerticalOffset="0"> |
| 362 | + <Button.IsEnabled> |
| 363 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 364 | + <Binding Path="IsCommitting" Converter="{x:Static BoolConverters.Not}"/> |
| 365 | + <Binding Path="CommitMessage" Converter="{x:Static c:StringConverters.IsNotNullOrWhitespace}"/> |
| 366 | + </MultiBinding> |
| 367 | + </Button.IsEnabled> |
| 368 | + |
349 | 369 | <Button.IsVisible> |
350 | 370 | <MultiBinding Converter="{x:Static BoolConverters.And}"> |
351 | 371 | <Binding Path="HasRemotes"/> |
|
0 commit comments