Skip to content

Commit 1acffe4

Browse files
committed
fix: Cleanup
1 parent 002a7e8 commit 1acffe4

5 files changed

Lines changed: 8 additions & 49 deletions

File tree

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
pkgs: libnick
4949
triplet: ${{ matrix.variant.triplet }}
50-
revision: e50305684899fdaa0e594679bc533effea0829cc
50+
revision: 4887ad6d1414f74cb7cb8d1e527fb46adb4e9ace
5151
token: ${{ github.token }}
5252
cache-key: ${{ matrix.variant.triplet }}
5353
- name: "Build (Installer)"

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform
5454
- Collect information about the bug:
5555
- Debug information provided by the application
5656
- GNOME: From the main hamburger menu, open About Application → Troubleshooting → Debugging Information and copy the information to the clipboard to paste in your issue.
57-
- WinUI: From the Help item in the left-side navigation, open About -> Debugging and copy the information to the clipboard to paste in your issue.
57+
- WinUI: From the Help item in the left-side navigation, open About Application --> Debugging and copy the information to the clipboard to paste in your issue.
5858
- Stack trace (Traceback)
5959
- Including any error messages thrown by the application
6060
- You may need to start the application via the terminal/console to receive an error message for a crash.
@@ -140,6 +140,7 @@ The whole project utilizes the [MVC](https://en.wikipedia.org/wiki/Model%E2%80%9
140140

141141
This project contains all of the code used by all platforms of the app:
142142
- `controllers` => The objects used by UI views to receive and manipulate data from the models.
143+
- `events` => Arguments that are used by events throughout the application.
143144
- `helpers` => Useful objects and functions specific to the application that can be used by all platforms.
144145
- `models` => The data driven objects of the application (i.e. Configuration, Database, etc...).
145146

@@ -158,7 +159,7 @@ This project contains all of the code used for the GNOME platform version of the
158159
This project contains all of the code used for the WinUI platform version of the app:
159160
- `controls` => Generic controls for the app.
160161
- These UI objects are separate from views in that they should not be backed by a controller and should be easily ported to any other app.
161-
- `helpers` => Useful objects and functions specific for the Qt platform version of the app.
162+
- `helpers` => Useful objects and functions specific for the WinUI platform version of the app.
162163
- `views` => The views (pages, windows, dialogs, etc...) of the app.
163164

164165
#### Developing and Testing
@@ -173,6 +174,7 @@ Application uses the following naming conventions:
173174
- `CamelCase` for namespaces and classes
174175
- `pascalCase` for file names, functions, and variables
175176
- `m_` prefix appended to class member variables
177+
- `s_` prefix appended to global static variables
176178
- `get` and `set` prefixes used for accessor and modifiers methods of a class variable respectively
177179
- Exception: For boolean class members, `is` and `setIs` should be used as the prefixes for the accessor and modifier methods of said members.
178180

org.nickvision.application.gnome/include/helpers/gtkhelpers.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,11 @@
88

99
namespace Nickvision::Application::GNOME::Helpers::GtkHelpers
1010
{
11-
/**
12-
* @brief Adds a widget to a GtkBox.
13-
* @param box The box to add the widget to
14-
* @param widget The widget to add
15-
* @param addSeparator Whether or not to add a separator between the widgets
16-
*/
17-
void addToBox(GtkBox* box, GtkWidget* widget, bool addSeparator = false);
1811
/**
1912
* @brief Runs the function on the main UI thread.
2013
* @param function The function to run
2114
*/
2215
void dispatchToMainThread(const std::function<void()>& function);
23-
/**
24-
* @brief Moves a widget from one box to another.
25-
* @param oldBox The old box
26-
* @param newBox The new box
27-
* @param widget The widget to move
28-
* @param addSeparator Whether or not to add a separator between the widgets
29-
*/
30-
void moveFromBox(GtkBox* oldBox, GtkBox* newBox, GtkWidget* widget, bool addSeparator = false);
3116
/**
3217
* @brief Sets the accelerator for an action.
3318
* @param app The GtkApplication

org.nickvision.application.gnome/src/helpers/gtkhelpers.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
namespace Nickvision::Application::GNOME::Helpers
44
{
5-
void GtkHelpers::addToBox(GtkBox* box, GtkWidget* widget, bool addSeparator)
6-
{
7-
if(addSeparator && gtk_widget_get_first_child(GTK_WIDGET(box)) != nullptr)
8-
{
9-
gtk_box_append(box, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
10-
}
11-
gtk_box_append(box, widget);
12-
}
13-
145
void GtkHelpers::dispatchToMainThread(const std::function<void()>& func)
156
{
167
g_idle_add(+[](gpointer data) -> int
@@ -22,25 +13,6 @@ namespace Nickvision::Application::GNOME::Helpers
2213
}, new std::function<void()>(func));
2314
}
2415

25-
void GtkHelpers::moveFromBox(GtkBox* oldBox, GtkBox* newBox, GtkWidget* widget, bool addSeparator)
26-
{
27-
GtkWidget* oldSeparator{ gtk_widget_get_prev_sibling(widget) };
28-
if(oldSeparator == nullptr)
29-
{
30-
oldSeparator = gtk_widget_get_next_sibling(widget);
31-
}
32-
if(addSeparator && oldSeparator && GTK_IS_SEPARATOR(oldSeparator))
33-
{
34-
gtk_box_remove(oldBox, oldSeparator);
35-
}
36-
gtk_box_remove(oldBox, widget);
37-
if(addSeparator && oldSeparator && GTK_IS_SEPARATOR(oldSeparator) && gtk_widget_get_first_child(GTK_WIDGET(newBox)) != nullptr)
38-
{
39-
gtk_box_append(newBox, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
40-
}
41-
gtk_box_append(newBox, widget);
42-
}
43-
4416
void GtkHelpers::setAccelForAction(GtkApplication* app, const char* action, const char* accel)
4517
{
4618
const char* accels[2] { accel, nullptr };

org.nickvision.application.winui/Controls/TitleBar.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
<ColumnDefinition x:Name="TitleColumn" Width="Auto"/>
1515
<ColumnDefinition x:Name="SubtitleColumn" Width="Auto"/>
1616
<ColumnDefinition x:Name="LeftDragColumn" Width="*"/>
17-
<ColumnDefinition x:Name="SearchColumn" Width="4*"/>
17+
<ColumnDefinition x:Name="SearchColumn" Width="4*" MinWidth="220"/>
1818
<ColumnDefinition x:Name="RightDragColumn" Width="*" MinWidth="48"/>
1919
<ColumnDefinition x:Name="RightPaddingColumn" Width="0"/>
2020
</Grid.ColumnDefinitions>
2121

2222
<Image x:Name="ImgIcon" Grid.Column="1" VerticalAlignment="Center" Margin="8,0,4,0" Width="18" Height="18" Source="../resources/icon.ico"/>
2323

24-
<TextBlock x:Name="LblTitle" Grid.Column="2" VerticalAlignment="Center" Margin="4,0,0,0" Style="{ThemeResource CaptionTextBlockStyle}" Text="{x:Bind Title, Mode=OneWay}"/>
24+
<TextBlock x:Name="LblTitle" Grid.Column="2" VerticalAlignment="Center" Style="{ThemeResource CaptionTextBlockStyle}" Text="{x:Bind Title, Mode=OneWay}"/>
2525

2626
<TextBlock x:Name="LblSubtitle" Grid.Column="3" VerticalAlignment="Center" Margin="12,0,0,0" Style="{ThemeResource CaptionTextBlockStyle}" Text="{x:Bind Subtitle, Mode=OneWay}" Foreground="Gray"/>
2727

28-
<AutoSuggestBox x:Name="AsbSearch" Grid.Column="5" QueryIcon="Find" VerticalAlignment="Center" MaxWidth="400" Visibility="{x:Bind SearchVisibility, Mode=OneWay}" TextChanged="OnSearchTextChanged" SuggestionChosen="OnSearchSuggestionChosen"/>
28+
<AutoSuggestBox x:Name="AsbSearch" Grid.Column="5" QueryIcon="Find" VerticalAlignment="Center" Margin="0,0,16,0" MaxWidth="400" Visibility="{x:Bind SearchVisibility, Mode=OneWay}" TextChanged="OnSearchTextChanged" SuggestionChosen="OnSearchSuggestionChosen"/>
2929
</Grid>
3030
</UserControl>

0 commit comments

Comments
 (0)