Skip to content

Commit d522417

Browse files
Renamed from "Bookmarks" to "Starred"
+ Renamed all variables from "bookmarks" to "starred", except for those in the user_places_xbel crate + Fixed glitch where List View headers would disappear early when shrinking the window into condensed view + Shrunk column widths to allow for more compact view before switching to condensed
1 parent 528c071 commit d522417

10 files changed

Lines changed: 231 additions & 207 deletions

File tree

i18n/en/cosmic_files.ftl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ networks = Networks
1010
notification-in-progress = File operations are in progress
1111
trash = Trash
1212
recents = Recents
13-
bookmarks = Bookmarks
13+
starred = Starred
1414
undo = Undo
1515
today = Today
1616
@@ -29,7 +29,7 @@ name = Name
2929
modified = Modified
3030
trashed-on = Trashed
3131
size = Size
32-
bookmarked = Bookmarked
32+
starred = Starred
3333
3434
# Progress footer
3535
details = Details
@@ -280,22 +280,22 @@ removed-from-recents = Removed {$items} {$items ->
280280
[one] item
281281
*[other] items
282282
} from {recents}
283-
adding-to-bookmarks = Adding {$items} {$items ->
283+
adding-to-starred = Adding {$items} {$items ->
284284
[one] item
285285
*[other] items
286-
} to {bookmarks}
287-
added-to-bookmarks = Added {$items} {$items ->
286+
} to {starred}
287+
added-to-starred = Added {$items} {$items ->
288288
[one] item
289289
*[other] items
290-
} to {bookmarks}
291-
removing-from-bookmarks = Removing {$items} {$items ->
290+
} to {starred}
291+
removing-from-starred = Removing {$items} {$items ->
292292
[one] item
293293
*[other] items
294-
} from {bookmarks}
295-
removed-from-bookmarks = Removed {$items} {$items ->
294+
} from {starred}
295+
removed-from-starred = Removed {$items} {$items ->
296296
[one] item
297297
*[other] items
298-
} from {bookmarks}
298+
} from {starred}
299299
renaming = Renaming "{$from}" to "{$to}"
300300
renamed = Renamed "{$from}" to "{$to}"
301301
restoring = Restoring {$items} {$items ->
@@ -329,7 +329,7 @@ error = Error
329329
settings = Settings
330330
single-click = Single click to open
331331
show-recents = Recents folder in the sidebar
332-
show-bookmarks = Show bookmarks
332+
show-starred = Show starred
333333
334334
### Appearance
335335
appearance = Appearance
@@ -346,8 +346,8 @@ type-to-search-select = Selects the first matching file or folder
346346
347347
# Context menu
348348
add-to-sidebar = Add to sidebar
349-
add-to-bookmarks = Add to bookmarks
350-
remove-from-bookmarks = Remove from bookmarks
349+
add-to-starred = Add to starred
350+
remove-from-starred = Remove from starred
351351
clear-recents-history = Clear recents history
352352
compress = Compress...
353353
copy-to = Copy to...

src/app.rs

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

src/config.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ pub struct Config {
167167
pub context_actions: Vec<ContextActionPreset>,
168168
pub thumb_cfg: ThumbCfg,
169169
pub favorites: Vec<Favorite>,
170-
pub bookmarks: Vec<Favorite>,
170+
pub starred: Vec<Favorite>,
171171
pub show_details: bool,
172172
pub show_recents: bool,
173-
pub show_bookmarks: bool,
173+
pub show_starred: bool,
174174
pub tab: TabConfig,
175175
pub type_to_search: TypeToSearch,
176176
}
@@ -213,7 +213,7 @@ impl Config {
213213
show_hidden: self.dialog.show_hidden,
214214
single_click: false,
215215
view: self.dialog.view,
216-
show_bookmarks: self.show_bookmarks
216+
show_starred: self.show_starred
217217
}
218218
}
219219
}
@@ -234,10 +234,10 @@ impl Default for Config {
234234
Favorite::Pictures,
235235
Favorite::Videos,
236236
],
237-
bookmarks: vec![],
237+
starred: vec![],
238238
show_details: false,
239239
show_recents: true,
240-
show_bookmarks: true,
240+
show_starred: true,
241241
tab: TabConfig::default(),
242242
type_to_search: TypeToSearch::Recursive,
243243
}
@@ -338,8 +338,8 @@ pub struct TabConfig {
338338
pub single_click: bool,
339339
/// Selected view, grid or list
340340
pub view: View,
341-
/// Show bookmarks icons
342-
pub show_bookmarks: bool,
341+
/// Show starred icons
342+
pub show_starred: bool,
343343
}
344344

345345
impl Default for TabConfig {
@@ -351,7 +351,7 @@ impl Default for TabConfig {
351351
show_hidden: false,
352352
single_click: false,
353353
view: View::List,
354-
show_bookmarks: false
354+
show_starred: false
355355
}
356356
}
357357
}

src/dialog.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ impl App {
780780
Some(SearchLocation::Path(path.clone()))
781781
} else if self.tab.location.is_recents() {
782782
Some(SearchLocation::Recents)
783-
} else if self.tab.location.is_bookmarks() {
784-
Some(SearchLocation::Bookmarks)
783+
} else if self.tab.location.is_starred() {
784+
Some(SearchLocation::Starred)
785785
} else if self.tab.location.is_trash() {
786786
Some(SearchLocation::Trash)
787787
} else {
@@ -804,7 +804,7 @@ impl App {
804804
Location::Search(search_location, ..) => match search_location {
805805
SearchLocation::Path(path) => Some((Location::Path(path.clone()), false)),
806806
SearchLocation::Recents => Some((Location::Recents, false)),
807-
SearchLocation::Bookmarks => Some((Location::Bookmarks, false)),
807+
SearchLocation::Starred => Some((Location::Starred, false)),
808808
SearchLocation::Trash => Some((Location::Trash, false)),
809809
},
810810
_ => None,
@@ -890,11 +890,11 @@ impl App {
890890
});
891891
}
892892

893-
if self.flags.config.show_bookmarks {
893+
if self.flags.config.show_starred {
894894
nav_model = nav_model.insert(|b| {
895-
b.text(fl!("bookmarks"))
895+
b.text(fl!("starred"))
896896
.icon(widget::icon::from_name("starred-symbolic"))
897-
.data(Location::Bookmarks)
897+
.data(Location::Starred)
898898
});
899899
}
900900

@@ -1856,7 +1856,7 @@ impl Application for App {
18561856
&app.key_binds,
18571857
&app.modifiers,
18581858
false, // Paste not used in dialogs
1859-
&false, // Show Bookmarks
1859+
&false, // Show Starred
18601860
&app.flags.config.context_actions,
18611861
)
18621862
.map(Message::TabMessage)
@@ -2067,7 +2067,7 @@ impl Application for App {
20672067
&self.key_binds,
20682068
&self.modifiers,
20692069
false, // Clipboard has content
2070-
&false, // Show Bookmarks
2070+
&false, // Show Starred
20712071
&[]
20722072
)
20732073
.map(Message::TabMessage),

src/key_bind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn key_binds(mode: &tab::Mode) -> HashMap<KeyBind, Action> {
5757

5858
// App-only keys
5959
if matches!(mode, tab::Mode::App) {
60-
bind!([Ctrl], Key::Character("d".into()), AddToBookmarks); // Taken over
60+
bind!([Ctrl], Key::Character("d".into()), AddToStarred); // Taken over
6161
bind!([Ctrl,Shift], Key::Character("d".into()), AddToSidebar); // Moved
6262
bind!([Ctrl], Key::Named(Named::Enter), OpenInNewTab);
6363
bind!([Ctrl], Key::Character(",".into()), Settings);

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
165165
log::warn!("recents feature is disabled in config");
166166
continue;
167167
}
168-
} else if &arg == "--bookmarks" {
169-
if config.show_bookmarks {
170-
Location::Bookmarks
168+
} else if &arg == "--starred" {
169+
if config.show_starred {
170+
Location::Starred
171171
} else {
172-
log::warn!("bookmarks feature is disabled in config");
172+
log::warn!("starred feature is disabled in config");
173173
continue;
174174
}
175175
} else if &arg == "--network" {

src/menu.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn context_menu<'a>(
5858
key_binds: &HashMap<KeyBind, Action>,
5959
modifiers: &Modifiers,
6060
clipboard_paste_available: bool,
61-
show_bookmarks: &bool,
61+
show_starred: &bool,
6262
context_actions: &[ContextActionPreset],
6363
) -> Element<'a, tab::Message> {
6464
let find_key = |action: &Action| -> String {
@@ -139,7 +139,7 @@ pub fn context_menu<'a>(
139139
let mut selected_types: Vec<Mime> = vec![];
140140
let mut selected_mount_point = 0;
141141
let mut any_trash_item = false;
142-
let mut bookmarked = 0;
142+
let mut starred = 0;
143143
if let Some(items) = tab.items_opt() {
144144
for item in items {
145145
if item.selected {
@@ -148,8 +148,8 @@ pub fn context_menu<'a>(
148148
selected_mount_point += i32::from(item.is_mount_point);
149149
selected_dir += 1;
150150
}
151-
if item.bookmarked {
152-
bookmarked += 1
151+
if item.starred {
152+
starred += 1
153153
}
154154
match &item.location_opt {
155155
Some(Location::Trash) | Some(Location::Search(SearchLocation::Trash, ..)) => {
@@ -202,9 +202,9 @@ pub fn context_menu<'a>(
202202
| Location::Path(..)
203203
| Location::Search(SearchLocation::Path(..), ..)
204204
| Location::Search(SearchLocation::Recents, ..)
205-
| Location::Search(SearchLocation::Bookmarks, ..)
205+
| Location::Search(SearchLocation::Starred, ..)
206206
| Location::Recents
207-
| Location::Bookmarks
207+
| Location::Starred
208208
| Location::Network(_, _, Some(_)),
209209
) => {
210210
if selected_trash_only {
@@ -298,17 +298,17 @@ pub fn context_menu<'a>(
298298
children.push(menu_item(fl!("delete-permanently"), Action::Delete).into());
299299
} else {
300300
children.push(divider::horizontal::light().into());
301-
if *show_bookmarks {
302-
if bookmarked > 0 || matches!(tab.location, Location::Bookmarks) {
301+
if *show_starred {
302+
if starred > 0 || matches!(tab.location, Location::Starred) {
303303
children.push(menu_item(
304-
fl!("remove-from-bookmarks"),
305-
Action::RemoveFromBookmarks
304+
fl!("remove-from-starred"),
305+
Action::RemoveFromStarred
306306
).into());
307307
}
308-
if bookmarked < selected && !matches!(tab.location, Location::Bookmarks) {
308+
if starred < selected && !matches!(tab.location, Location::Starred) {
309309
children.push(menu_item(
310-
fl!("add-to-bookmarks"),
311-
Action::AddToBookmarks
310+
fl!("add-to-starred"),
311+
Action::AddToStarred
312312
).into());
313313
}
314314
}
@@ -342,7 +342,7 @@ pub fn context_menu<'a>(
342342
} else {
343343
//TODO: need better designs for menu with no selection
344344
//TODO: have things like properties but they apply to the folder?
345-
if tab.location != Location::Recents && tab.location != Location::Bookmarks {
345+
if tab.location != Location::Recents && tab.location != Location::Starred {
346346
children.push(menu_item(fl!("new-folder"), Action::NewFolder).into());
347347
children.push(menu_item(fl!("new-file"), Action::NewFile).into());
348348
children.push(menu_item(fl!("open-in-terminal"), Action::OpenTerminal).into());
@@ -391,9 +391,9 @@ pub fn context_menu<'a>(
391391
| Location::Path(..)
392392
| Location::Search(SearchLocation::Path(..), ..)
393393
| Location::Search(SearchLocation::Recents, ..)
394-
| Location::Search(SearchLocation::Bookmarks, ..)
394+
| Location::Search(SearchLocation::Starred, ..)
395395
| Location::Recents
396-
| Location::Bookmarks
396+
| Location::Starred
397397
| Location::Network(_, _, Some(_)),
398398
) => {
399399
if selected > 0 {
@@ -711,8 +711,8 @@ pub fn menu_bar<'a>(
711711
menu::Item::Button(fl!("reload-folder"), None, Action::Reload),
712712
menu::Item::Divider,
713713
menu_button_optional(
714-
fl!("add-to-bookmarks"),
715-
Action::AddToBookmarks,
714+
fl!("add-to-starred"),
715+
Action::AddToStarred,
716716
selected > 0,
717717
),
718718
menu_button_optional(
@@ -858,9 +858,9 @@ pub fn location_context_menu<'a>(ancestor_index: usize, tab_mode: tab::Mode) ->
858858

859859
if matches!(tab_mode, tab::Mode::App) {
860860
children.push(divider::horizontal::light().into());
861-
children.push(menu_button!(text::body(fl!("add-to-bookmarks")))
861+
children.push(menu_button!(text::body(fl!("add-to-starred")))
862862
.on_press(tab::Message::LocationMenuAction(
863-
LocationMenuAction::AddToBookmarks(ancestor_index),
863+
LocationMenuAction::AddToStarred(ancestor_index),
864864
))
865865
.into());
866866
children.push(menu_button!(text::body(fl!("add-to-sidebar")))

src/mounter/gvfs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ fn network_scan(uri: &str, sizes: IconSizes) -> Result<Vec<tab::Item>, String> {
212212
rect_opt: Cell::new(None),
213213
selected: false,
214214
highlighted: false,
215-
bookmarked: false,
215+
starred: false,
216216
overlaps_drag_rect: false,
217217
//TODO: scan directory size on gvfs mounts?
218218
dir_size: DirSize::NotDirectory,

0 commit comments

Comments
 (0)