Compare commits

..
Author SHA1 Message Date
Alexander Shaduri 871cd51e8a Merge pull request #121 from OldMan2525/main
Use bundled icons when theme icons are too small
2026-07-08 20:57:37 +02:00
OldMan2525 fa31a696a7 Use bundled icons when theme icons are too small
Some icon themes may return a lower-resolution icon than requested.
For example, under XQuartz on macOS, Gtk::IconTheme::load_icon()
returns a 16x16 drive-harddisk icon even when a 64x64 icon is
requested.

Because the theme lookup succeeds, the bundled higher-resolution
icons are never used, resulting in tiny drive icons in the main
window.

Fall back to the bundled icon when the theme-provided icon is
smaller than the requested size.
2026-07-07 02:13:11 -07:00
Alexander Shaduri cab21bd6dd Add scam alert and download instructions to index.md
Added a scam alert regarding a phishing site and provided guidance on downloading GSmartControl from official sources.
2026-05-31 11:55:43 +02:00
Alexander Shaduri 19c50fdd72 Add scam alert and official download links to README
Added a scam alert about a phishing site and provided official download links.
2026-05-31 11:54:47 +02:00
4 changed files with 24 additions and 4 deletions
+6
View File
@@ -12,6 +12,12 @@
---
**SCAM ALERT:** gsmartcontrol[.]com is a phishing site! Please don't download anything from there!
Please always download GSmartControl from its official website [gsmartcontrol.shaduri.dev](https://gsmartcontrol.shaduri.dev) or the official GitHub repository [github.com/ashaduri/gsmartcontrol](https://github.com/ashaduri/gsmartcontrol).
---
[GSmartControl](https://gsmartcontrol.shaduri.dev)
is a graphical user interface for smartctl (from [smartmontools](https://www.smartmontools.org/)
package), which is a tool for
+6
View File
@@ -13,6 +13,12 @@ nav_order: 1
---
**SCAM ALERT:** gsmartcontrol[.]com is a phishing site! Please don't download anything from there!
Please always download GSmartControl from its official website [gsmartcontrol.shaduri.dev](https://gsmartcontrol.shaduri.dev) or the official GitHub repository [github.com/ashaduri/gsmartcontrol](https://github.com/ashaduri/gsmartcontrol).
---
[GSmartControl](https://gsmartcontrol.shaduri.dev)
is a graphical user interface for smartctl (from [smartmontools](https://www.smartmontools.org/)
package), which is a tool for
+3 -3
View File
@@ -765,7 +765,7 @@ void GscMainWindow::update_status_widgets()
+ (model.empty() ? "" : (", " + model));
if (name_label_) {
name_label_->set_markup(info_str);
app_gtkmm_set_widget_tooltip(*name_label_, info_str, true); // in case it doesn't fit
app_gtkmm_set_widget_tooltip(*name_label_, info_str, false); // in case it doesn't fit
}
const StorageProperty health_prop = drive->get_health_property();
@@ -793,8 +793,8 @@ void GscMainWindow::update_status_widgets()
}
if (family_label_) {
family_label_->set_markup(family);
app_gtkmm_set_widget_tooltip(*family_label_, family, true); // in case it doesn't fit
family_label_->set_text(family);
app_gtkmm_set_widget_tooltip(*family_label_, family, false); // in case it doesn't fit
}
// std::string status_str = " " + device + (size.empty() ? "" : (", " + size)) + (family_fallback.empty() ? "" : (", " + family_fallback));
+9 -1
View File
@@ -554,10 +554,18 @@ Glib::RefPtr<Gdk::Pixbuf> GscMainWindowIconView::load_icon_pixbuf(Glib::RefPtr<G
{
Glib::RefPtr<Gdk::Pixbuf> icon;
// Try XDG version first
// Try the icon theme first; fall back to the bundled icon if needed.
try {
if (default_icon_theme && !xdg_icon_name.empty()) {
icon = default_icon_theme->load_icon(xdg_icon_name, icon_size_, get_scale_factor(), Gtk::IconLookupFlags(0));
// Some icon themes may return an icon smaller than requested.
// In that case, fall back to the bundled icon.
if (icon &&
(icon->get_width() < icon_size_ ||
icon->get_height() < icon_size_)) {
icon.reset();
}
}
} catch (...) { } // ignore exceptions