Skip to content

Commit

Permalink
Add hide close button feature #104
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ward committed Jan 9, 2022
1 parent 65f78bd commit 9292396
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/tweetz.core/Interfaces/ISettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel;
using tweetz.core.Models;

namespace tweetz.core.Interfaces
Expand All @@ -20,6 +19,7 @@ public interface ISettings : INotifyPropertyChanged
bool HideTranslate { get; }
bool HideRetweets { get; set; }
bool HideNoMediaTweets { get; set; }
bool HideCloseButton { get; set; }
bool SpellCheck { get; set; }
bool ShowInSystemTray { get; set; }
bool AlwaysOnTop { get; set; }
Expand Down
8 changes: 8 additions & 0 deletions src/tweetz.core/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public Settings(IMessageBoxService messageBoxService)
private bool hideTranslate;
private bool hideRetweets;
private bool hideNoMediaTweets;
private bool hideCloseButton;
private bool donated;
private bool spellCheck;
private bool showInSystemTray;
Expand Down Expand Up @@ -152,6 +153,12 @@ public bool HideNoMediaTweets
set => SetProperty(ref hideNoMediaTweets, value);
}

public bool HideCloseButton
{
get => hideCloseButton;
set => SetProperty(ref hideCloseButton, value);
}

public bool SpellCheck
{
get => spellCheck;
Expand Down Expand Up @@ -285,6 +292,7 @@ private void CopySettings(Settings settings)
HideTranslate = settings.HideTranslate;
HideRetweets = settings.HideRetweets;
HideNoMediaTweets = settings.hideNoMediaTweets;
HideCloseButton = settings.hideCloseButton;
SpellCheck = settings.SpellCheck;
ShowInSystemTray = settings.showInSystemTray;
AlwaysOnTop = settings.alwaysOnTop;
Expand Down
1 change: 1 addition & 0 deletions src/tweetz.core/Resources/Strings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<sys:String x:Key="hide-translate-link">Hide translate link</sys:String>
<sys:String x:Key="hide-retweets">Hide retweets</sys:String>
<sys:String x:Key="hide-no-media-tweets">Hide tweets with no media</sys:String>
<sys:String x:Key="hide-close-button">Hide close button</sys:String>
<sys:String x:Key="run-on-startup">Run on startup</sys:String>
<sys:String x:Key="font-size-title">Font size</sys:String>
<sys:String x:Key="theme-title">Theme</sys:String>
Expand Down
3 changes: 1 addition & 2 deletions src/tweetz.core/ViewModels/TitleBarControlViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Windows;
using tweetz.core.Extensions;
using tweetz.core.Extensions;
using tweetz.core.Interfaces;

namespace tweetz.core.ViewModels
Expand Down
6 changes: 6 additions & 0 deletions src/tweetz.core/Views/SettingsBlock/SettingsOptionsBlock.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Settings.HideCloseButton}">
<TextBlock
Text="{StaticResource hide-close-button}"
TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Settings.HidePossiblySensitive}">
<TextBlock
Text="{StaticResource hide-possibly-sensitive}"
Expand Down
3 changes: 2 additions & 1 deletion src/tweetz.core/Views/TitleBarView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
MouseDown="Close"
Text="&#x2573;"
TextAlignment="Center"
ToolTip="{StaticResource close-tooltip}">
ToolTip="{StaticResource close-tooltip}"
Visibility="{Binding Settings.HideCloseButton, Converter={StaticResource NotBooleanToVisibilityConverter}}">
<TextBlock.Style>
<Style>
<Style.Triggers>
Expand Down

0 comments on commit 9292396

Please sign in to comment.