Skip to content

Commit fb8d828

Browse files
committed
Fixed some bug and changed logo
1 parent 2fdc8dc commit fb8d828

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

CutCode/Resources/Images/logo.png

165 KB
Loading

CutCode/ViewModels/FavViewModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ public void SearchCommand(string text)
140140
}
141141
else
142142
{
143-
AllCodes = database.SearchCode(text, "Home");
144-
if (AllCodes.Count == 0) VisChange("Not found :(");
143+
if(AllCodes.Count > 0)
144+
{
145+
AllCodes = database.SearchCode(text, "Home");
146+
if (AllCodes.Count == 0) VisChange("Not found :(");
147+
}
145148
}
146149
IsSearched = true;
147150
}

CutCode/ViewModels/HomeViewModel.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,22 +190,29 @@ public string CurrentSort2
190190

191191
private void ComboBoxItemSelected(string kind)
192192
{
193-
AllCodes = database.OrderCode(kind);
194-
VisChange("Not found :(");
193+
if(AllCodes.Count > 0)
194+
{
195+
AllCodes = database.OrderCode(kind);
196+
VisChange("Not found :(");
197+
}
195198
}
196199

197200
public void SearchCommand(string text)
198201
{
199202
IsSearched = false;
200203
if(text == "")
201204
{
205+
202206
AllCodes = database.AllCodes;
203207
VisChange();
204208
}
205209
else
206210
{
207-
AllCodes = database.SearchCode(text, "Home");
208-
VisChange("Not found :(");
211+
if (AllCodes.Count > 0)
212+
{
213+
AllCodes = database.SearchCode(text, "Home");
214+
VisChange("Not found :(");
215+
}
209216
}
210217
IsSearched = true;
211218
}

CutCode/Views/MainView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<RowDefinition Height="*"/>
7777
</Grid.RowDefinitions>
7878

79-
<Image Grid.Row="0" Source="../Resources/Images/logo.png" Width="30" Height="30" Margin="15,12,7,7"
79+
<Image Grid.Row="0" Source="../Resources/Images/logo.png" Width="35" Height="35" Margin="15,12,7,7"
8080
RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.EdgeMode="Aliased"/>
8181

8282
<!-- Side Bar Buttons -->
@@ -108,7 +108,7 @@
108108

109109
<Grid Grid.Column="1">
110110
<Grid.RowDefinitions>
111-
<RowDefinition Height="48"/>
111+
<RowDefinition Height="54"/>
112112
<RowDefinition Height="*"/>
113113
</Grid.RowDefinitions>
114114
<Grid Grid.Row="0" Background="{Binding titleBarColor}" MouseDown="ChangeWindowPosition" MouseMove="MaxChangeWindowPosition">

0 commit comments

Comments
 (0)