Skip to content

Commit

Permalink
chore: UI Improvements (#15)
Browse files Browse the repository at this point in the history
Adding icons to Bookmarks page.

Update icons placement in Accounts page.

Updating screenshots.
  • Loading branch information
vkhitrin authored Dec 6, 2024
1 parent f6dc6ed commit 08345d5
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ While cosmicding was desgined for COSMIC™ Desktop Environment, it should be ab
Features:

- Support multiple linkding instances (or multiple users on the same instance).
- Cache/aggregate bookmarks locally.
- Aggregate bookmarks locally.
- Add/Edit/Remove bookmarks.
- Search bookmarks based on title, URL, tags, desscription, and notes.

Expand Down
2 changes: 1 addition & 1 deletion i18n/en/cosmicding.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ provided-url-is-not-valid = Provided URL is not valid
quit = Quit
refresh = Refresh
refresh-bookmarks = Refresh Bookmarks
refreshed-all-bookmarks = Refreshed all bookmarks
refreshed-bookmarks = Refreshed bookmarks
refreshed-bookmarks-for-account = Refreshed account {$acc}
remove = Remove
remove-account-confirm = Are you sure you wish to delete this account?
Expand Down
Binary file modified res/screenshots/accounts.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 res/screenshots/bookmarks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ impl Application for Cosmicding {
));
commands.push(
self.toasts
.push(widget::toaster::Toast::new(fl!("refreshed-all-bookmarks")))
.push(widget::toaster::Toast::new(fl!("refreshed-bookmarks")))
.map(cosmic::app::Message::App),
);
}
Expand Down
20 changes: 14 additions & 6 deletions src/pages/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl PageAccountsView {
let mut columns = Vec::new();
columns.push(
widget::row::with_capacity(2)
.spacing(spacing.space_xxs)
.spacing(spacing.space_xs)
.push(widget::icon::from_name("user-available-symbolic"))
.push(widget::text(item.display_name.clone()))
.padding([
Expand All @@ -84,7 +84,7 @@ impl PageAccountsView {
// Mandatory second row - sync status
columns.push(
widget::row::with_capacity(2)
.spacing(spacing.space_xxs)
.spacing(spacing.space_xs)
.padding([
spacing.space_xxxs,
spacing.space_xxs,
Expand All @@ -101,12 +101,13 @@ impl PageAccountsView {
fl!("failed")
}
)))
.align_y(Alignment::Center)
.into(),
);
// Mandatory third row - sync timestamp
columns.push(
widget::row::with_capacity(2)
.spacing(spacing.space_xxs)
.spacing(spacing.space_xs)
.padding([
spacing.space_xxxs,
spacing.space_xxs,
Expand All @@ -119,12 +120,13 @@ impl PageAccountsView {
fl!("last-sync-time"),
local_time.to_rfc2822()
)))
.align_y(Alignment::Center)
.into(),
);
// Mandatory fourth row - details
columns.push(
widget::row::with_capacity(2)
.spacing(spacing.space_xxs)
.spacing(spacing.space_xs)
.padding([
spacing.space_xxxs,
spacing.space_xxs,
Expand All @@ -149,25 +151,31 @@ impl PageAccountsView {
widget::text::body(fl!("disabled-public-sharing")).into()
},
])))
.align_y(Alignment::Center)
.into(),
);
// Mandatory fifth row - actions
let actions_row = widget::row::with_capacity(3)
.spacing(spacing.space_xxs)
.push(widget::button::link(fl!("refresh")).on_press(
.spacing(spacing.space_xs)
.push(widget::button::link(fl!("refresh")).font_size(12).on_press(
AppAccountsMessage::RefreshBookmarksForAccount(item.to_owned()),
))
.push(
widget::button::link(fl!("edit"))
.font_size(12)
.on_press(AppAccountsMessage::EditAccount(item.to_owned())),
)
.push(
widget::button::link(fl!("remove"))
.font_size(12)
.on_press(AppAccountsMessage::DeleteAccount(item.to_owned())),
)
.push(
widget::button::link(fl!("open-instance"))
.spacing(spacing.space_xxxs)
.trailing_icon(true)
.icon_size(10)
.font_size(12)
.on_press(AppAccountsMessage::OpenExternalURL(item.instance.clone()))
.tooltip(item.instance.clone()),
);
Expand Down
41 changes: 29 additions & 12 deletions src/pages/bookmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,48 +75,63 @@ impl PageBookmarksView {
let mut columns = Vec::new();
// Mandatory first row - title
columns.push(
widget::row::with_capacity(1)
widget::row::with_capacity(2)
.spacing(spacing.space_xxs)
.padding([
spacing.space_xxxs,
spacing.space_xxs,
spacing.space_xxxs,
spacing.space_xxs,
spacing.space_none,
spacing.space_xxxs,
])
.push(widget::icon::from_name("web-browser-symbolic"))
.push(
widget::button::link(item.title.clone())
.spacing(spacing.space_xxxs)
.trailing_icon(true)
.icon_size(11)
.tooltip(item.url.clone())
.on_press(AppBookmarksMessage::OpenExternalURL(item.url.clone())),
)
.align_y(Alignment::Center)
.into(),
);
// Optional second row - description
if !item.description.is_empty() {
columns.push(
widget::row::with_capacity(1)
.spacing(spacing.space_xxs)
widget::row::with_capacity(2)
.spacing(spacing.space_xs)
.padding([
spacing.space_xxxs,
spacing.space_xxs,
spacing.space_xxs,
if item.tag_names.is_empty() {
spacing.space_xxxs
} else {
spacing.space_none
},
spacing.space_xxxs,
])
.push(widget::icon::from_name("emblem-documents-symbolic"))
.push(widget::text(item.description.clone()))
.align_y(Alignment::Start)
.into(),
);
}
// Optional third row - tags
if !item.tag_names.is_empty() {
columns.push(
widget::row::with_capacity(2)
.spacing(spacing.space_none)
.spacing(spacing.space_xs)
.padding([
spacing.space_none,
if item.description.is_empty() {
spacing.space_xxxs
} else {
spacing.space_xxs
},
spacing.space_xxs,
spacing.space_xxxs,
spacing.space_xxxs,
])
.push(widget::icon::from_name("mail-mark-important-symbolic"))
.push(
widget::text::body(
item.tag_names
Expand All @@ -127,19 +142,20 @@ impl PageBookmarksView {
)
.size(12),
)
.align_y(Alignment::Center)
.into(),
);
}
// Mandatory fourth row - actions
let mut actions_row = widget::row::with_capacity(1)
.spacing(spacing.space_xxs)
.push(widget::button::link(fl!("edit")).on_press(
.push(widget::button::link(fl!("edit")).font_size(12).on_press(
AppBookmarksMessage::EditBookmark(
derived_account.to_owned(),
item.to_owned(),
),
))
.push(widget::button::link(fl!("remove")).on_press(
.push(widget::button::link(fl!("remove")).font_size(12).on_press(
AppBookmarksMessage::DeleteBookmark(
derived_account.to_owned(),
item.to_owned(),
Expand All @@ -148,6 +164,7 @@ impl PageBookmarksView {
if !item.notes.is_empty() {
actions_row = actions_row.push(
widget::button::link(fl!("notes"))
.font_size(12)
.on_press(AppBookmarksMessage::ViewNotes(item.clone())),
);
}
Expand All @@ -156,7 +173,7 @@ impl PageBookmarksView {
.padding([
spacing.space_none,
spacing.space_xxs,
spacing.space_xxxs,
spacing.space_none,
spacing.space_none,
])
.into(),
Expand Down Expand Up @@ -208,7 +225,7 @@ impl PageBookmarksView {
.height(Length::Fill);

widget::container(
widget::column::with_children(vec![widget::row::with_capacity(3)
widget::column::with_children(vec![widget::row::with_capacity(2)
.align_y(Alignment::Center)
.push(widget::text::title3(fl!(
"bookmarks-with-count",
Expand Down

0 comments on commit 08345d5

Please sign in to comment.