mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-18 17:56:56 +02:00
feat(bar): add update widget
This commit adds a new widget, "Update", which will check for komorebi version updates using the cargo package version of the running binary and the latest release returned from the GitHub API. If the latest release is newer than the current cargo package version, a widget will be shown, which can be clicked to open the changelog of the latest release.
This commit is contained in:
@@ -17,6 +17,8 @@ use crate::storage::Storage;
|
||||
use crate::storage::StorageConfig;
|
||||
use crate::time::Time;
|
||||
use crate::time::TimeConfig;
|
||||
use crate::update::Update;
|
||||
use crate::update::UpdateConfig;
|
||||
use eframe::egui::Context;
|
||||
use eframe::egui::Ui;
|
||||
use schemars::JsonSchema;
|
||||
@@ -38,6 +40,7 @@ pub enum WidgetConfig {
|
||||
Network(NetworkConfig),
|
||||
Storage(StorageConfig),
|
||||
Time(TimeConfig),
|
||||
Update(UpdateConfig),
|
||||
}
|
||||
|
||||
impl WidgetConfig {
|
||||
@@ -52,6 +55,7 @@ impl WidgetConfig {
|
||||
WidgetConfig::Network(config) => Box::new(Network::from(*config)),
|
||||
WidgetConfig::Storage(config) => Box::new(Storage::from(*config)),
|
||||
WidgetConfig::Time(config) => Box::new(Time::from(config.clone())),
|
||||
WidgetConfig::Update(config) => Box::new(Update::from(*config)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +78,7 @@ impl WidgetConfig {
|
||||
WidgetConfig::Network(config) => config.enable,
|
||||
WidgetConfig::Storage(config) => config.enable,
|
||||
WidgetConfig::Time(config) => config.enable,
|
||||
WidgetConfig::Update(config) => config.enable,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user