Skip to content

Commit

Permalink
Release 2.7.4 (#76)
Browse files Browse the repository at this point in the history
* Lint

* Optimised images with calibre/image-actions

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
cassidyjames and github-actions[bot] authored Feb 17, 2020
1 parent 8a8138b commit c03a060
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 75 deletions.
1 change: 0 additions & 1 deletion data/Application.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@define-color PURPLE #525;
@define-color colorAccent @PURPLE;

15 changes: 6 additions & 9 deletions data/com.github.cassidyjames.dippi.appdata.xml.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018 Cassidy James Blaede <[email protected]> -->
<!-- Copyright 2018–2020 Cassidy James Blaede <[email protected]> -->
<component type="desktop">
<id>com.github.cassidyjames.dippi</id>
<metadata_license>CC0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Dippi</name>
<summary>Calculate display info like DPI and aspect ratio</summary>

<description>
<p>Analyze any display. Input a few simple details and figure out the aspect ratio, DPI, and other details of a particular display. Great for deciding which laptop or external monitor to purchase, and if it would be considered HiDPI.</p>
<p>Handy features:</p>
Expand Down Expand Up @@ -40,8 +39,12 @@
<provides>
<binary>com.github.cassidyjames.dippi</binary>
</provides>

<releases>
<release version="2.7.4" date="2020-02-17">
<description>
<p>Code style and organization fixes</p>
</description>
</release>
<release version="2.7.3" date="2019-04-09">
<description>
<p>Updated translations</p>
Expand Down Expand Up @@ -225,7 +228,6 @@
</description>
</release>
</releases>

<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshot.png</image>
Expand All @@ -240,7 +242,6 @@
<image>https://raw.githubusercontent.com/cassidyjames/dippi/master/data/screenshot-4.png</image>
</screenshot>
</screenshots>

<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
Expand Down Expand Up @@ -270,20 +271,16 @@
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>

<developer_name>Cassidy James Blaede</developer_name>

<url type="homepage">https://cassidyjames.com</url>
<url type="bugtracker">https://github.com/cassidyjames/dippi/issues</url>
<url type="translate">https://github.com/cassidyjames/dippi/tree/master/po#readme</url>
<url type="donation">https://cassidyjames.com/pay</url>
<url type="help">https://cassidyjames.com/support</url>
<!--url type="contact">https://cassidyjames.com/support</url-->

<custom>
<value key="x-appcenter-color-primary">#525</value>
<value key="x-appcenter-color-primary-text">#fffffc</value>
<value key="x-appcenter-suggested-price">4</value>
</custom>
</component>

1 change: 0 additions & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ if appstreamcli.found()
args: ['validate', join_paths(meson.current_build_dir (), meson.project_name() + '.appdata.xml')]
)
endif

Binary file modified data/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
project('com.github.cassidyjames.dippi', 'vala', 'c')
project(
'com.github.cassidyjames.dippi',
'vala', 'c',
version: '2.7.4'
)

gnome = import('gnome')
i18n = import('i18n')
Expand Down
29 changes: 1 addition & 28 deletions src/Application.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 Cassidy James Blaede (https://cassidyjames.com)
* Copyright © 2018–2020 Cassidy James Blaede (https://cassidyjames.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -34,32 +34,6 @@ public class Dippi : Gtk.Application {
add_action (quit_action);
set_accels_for_action ("app.quit", {"Escape"});

const string DESKTOP_SCHEMA = "org.freedesktop";
const string PREFERS_KEY = "prefers-color-scheme";

var lookup = SettingsSchemaSource.get_default ().lookup (DESKTOP_SCHEMA, false);

if (lookup != null) {
var desktop_settings = new Settings (DESKTOP_SCHEMA);
var gtk_settings = Gtk.Settings.get_default ();

desktop_settings.bind_with_mapping (
PREFERS_KEY,
gtk_settings,
"gtk-application-prefer-dark-theme",
SettingsBindFlags.DEFAULT,
(value, variant) => {
value.set_boolean (variant.get_string () == "dark");
return true;
},
(value, expected_type) => {
return new Variant.string(value.get_boolean() ? "dark" : "no-preference");
},
null,
null
);
}

var provider = new Gtk.CssProvider ();
provider.load_from_resource ("/com/github/cassidyjames/dippi/Application.css");
Gtk.StyleContext.add_provider_for_screen (
Expand All @@ -82,4 +56,3 @@ public class Dippi : Gtk.Application {
return app.run (args);
}
}

59 changes: 29 additions & 30 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 Cassidy James Blaede (https://cassidyjames.com)
* Copyright © 2018–2020 Cassidy James Blaede (https://cassidyjames.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -75,7 +75,7 @@ public class MainWindow : Gtk.Window {
return _("Analyze a Display");

default:
assert_not_reached();
assert_not_reached ();
}
}

Expand Down Expand Up @@ -112,7 +112,7 @@ public class MainWindow : Gtk.Window {
return _("Enter details about a display to analyze it.");

default:
assert_not_reached();
assert_not_reached ();
}
}

Expand All @@ -137,7 +137,7 @@ public class MainWindow : Gtk.Window {
return "dialog-information";

default:
assert_not_reached();
assert_not_reached ();
}
}
}
Expand Down Expand Up @@ -196,7 +196,7 @@ public class MainWindow : Gtk.Window {
var diag_label = new Gtk.Label (_("Diagonal size:"));
diag_label.halign = Gtk.Align.END;

diag_entry = new Gtk.Entry();
diag_entry = new Gtk.Entry ();
diag_entry.max_length = 5;
diag_entry.max_width_chars = 5;
diag_entry.width_chars = 5;
Expand All @@ -209,7 +209,7 @@ public class MainWindow : Gtk.Window {
var res_label = new Gtk.Label (_("Resolution:"));
res_label.halign = Gtk.Align.END;

width_entry = new Gtk.Entry();
width_entry = new Gtk.Entry ();
width_entry.max_length = 5;
width_entry.max_width_chars = 5;
width_entry.width_chars = 5;
Expand All @@ -219,7 +219,7 @@ public class MainWindow : Gtk.Window {
return focus_in_event (event);
});

height_entry = new Gtk.Entry();
height_entry = new Gtk.Entry ();
height_entry.max_length = 5;
height_entry.max_width_chars = 5;
height_entry.width_chars = 5;
Expand Down Expand Up @@ -300,7 +300,7 @@ public class MainWindow : Gtk.Window {
);

if (!height_entry.has_focus && (is_default_height || height == 0)) {
double calculated_height = Math.round(
double calculated_height = Math.round (
width *
DEFAULT_ASPECT_HEIGHT /
DEFAULT_ASPECT_WIDTH
Expand All @@ -322,7 +322,7 @@ public class MainWindow : Gtk.Window {
);

if (!width_entry.has_focus && (is_default_width || width == 0)) {
double calculated_width = Math.round(
double calculated_width = Math.round (
height *
DEFAULT_ASPECT_WIDTH /
DEFAULT_ASPECT_HEIGHT
Expand All @@ -343,7 +343,7 @@ public class MainWindow : Gtk.Window {
break;

default:
assert_not_reached();
assert_not_reached ();
}

assess_dpi (Utils.dpi (inches, width, height), display_type);
Expand All @@ -357,17 +357,17 @@ public class MainWindow : Gtk.Window {
data_grid.row_spacing = 6;
data_grid.get_style_context ().add_class ("data-grid");

data_grid.attach (diagram, 0, 0, 5, 1);
data_grid.attach (diag_label, 0, 1, 1, 1);
data_grid.attach (diag_entry, 1, 1, 1, 1);
data_grid.attach (inches_label, 2, 1, 2, 1);
data_grid.attach (res_label, 0, 2, 1, 1);
data_grid.attach (width_entry, 1, 2, 1, 1);
data_grid.attach (x_label, 2, 2, 1, 1);
data_grid.attach (height_entry, 3, 2, 1, 1);
data_grid.attach (px_label, 4, 2, 1, 1);
data_grid.attach (type_label, 0, 3, 1, 1);
data_grid.attach (type_modebutton, 1, 3, 4, 1);
data_grid.attach (diagram, 0, 0, 5);
data_grid.attach (diag_label, 0, 1);
data_grid.attach (diag_entry, 1, 1);
data_grid.attach (inches_label, 2, 1, 2);
data_grid.attach (res_label, 0, 2);
data_grid.attach (width_entry, 1, 2);
data_grid.attach (x_label, 2, 2);
data_grid.attach (height_entry, 3, 2);
data_grid.attach (px_label, 4, 2);
data_grid.attach (type_label, 0, 3);
data_grid.attach (type_modebutton, 1, 3, 4);

var assessment_grid = new Gtk.Grid ();
assessment_grid.column_spacing = 12;
Expand All @@ -378,20 +378,20 @@ public class MainWindow : Gtk.Window {
assessment_grid.valign = Gtk.Align.START;
assessment_grid.get_style_context ().add_class ("assessment-grid");

assessment_grid.attach (range_icon, 0, 0, 1, 2);
assessment_grid.attach (range_title_label, 1, 0, 3, 1);
assessment_grid.attach (range_description_label, 1, 1, 3, 1);
assessment_grid.attach (aspect_result_label, 1, 2, 1, 1);
assessment_grid.attach (dpi_result_label, 2, 2, 1, 1);
assessment_grid.attach (logical_resolution_label, 3, 2, 1, 1);
assessment_grid.attach (range_icon, 0, 0, 1, 2);
assessment_grid.attach (range_title_label, 1, 0, 3);
assessment_grid.attach (range_description_label, 1, 1, 3);
assessment_grid.attach (aspect_result_label, 1, 2);
assessment_grid.attach (dpi_result_label, 2, 2);
assessment_grid.attach (logical_resolution_label, 3, 2);

var main_layout = new Gtk.Grid ();
main_layout.column_spacing = 6;
main_layout.height_request = 258;
main_layout.row_spacing = 6;
main_layout.width_request = 710;
main_layout.attach (data_grid, 0, 0, 1, 1);
main_layout.attach (assessment_grid, 1, 0, 1, 1);
main_layout.attach (data_grid, 0, 0);
main_layout.attach (assessment_grid, 1, 0);

diag_entry.grab_focus ();

Expand Down Expand Up @@ -528,4 +528,3 @@ public class MainWindow : Gtk.Window {
diagram.icon_name = "display-measure-" + direction + display_type.icon_suffix ();
}
}

9 changes: 4 additions & 5 deletions src/Utils.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 Cassidy James Blaede (https://cassidyjames.com)
* Copyright © 2018–2020 Cassidy James Blaede (https://cassidyjames.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -33,7 +33,7 @@ namespace Utils {
return _("Desktop");

default:
assert_not_reached();
assert_not_reached ();
}
}

Expand All @@ -46,13 +46,13 @@ namespace Utils {
return "";

default:
assert_not_reached();
assert_not_reached ();
}
}
}

public int dpi (double inches, int width, int height) {
double unrounded_dpi = Math.sqrt(
double unrounded_dpi = Math.sqrt (
Math.pow (width, 2) +
Math.pow (height, 2)
) / inches;
Expand All @@ -77,4 +77,3 @@ namespace Utils {
}
}
}

0 comments on commit c03a060

Please sign in to comment.