Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ rfd.workspace = true
serde_json.workspace = true
uuid.workspace = true

[target.'cfg(any(windows, target_os = "macos"))'.dependencies]
raw-window-handle.workspace = true

[target.'cfg(windows)'.dependencies]
eframe = { workspace = true, features = ["glow"] }
raw-window-handle.workspace = true
windows-sys.workspace = true

[target.'cfg(not(windows))'.dependencies]
Expand Down
13 changes: 4 additions & 9 deletions crates/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl eframe::App for Shell {
let ctx = ui.ctx().clone();
observability::show_pending_crash_dialog();
self.scale.drive(&mut self.app, &ctx, frame);
let ribbon_chrome = ui::current_ribbon_chrome(&ctx, frame);
let recovery_blocked = self.pending_recovery.is_some();
#[cfg(target_os = "macos")]
if !recovery_blocked {
Expand Down Expand Up @@ -160,6 +161,7 @@ impl eframe::App for Shell {
&mut self.batch_workflow,
ui,
recovery_blocked,
ribbon_chrome,
);
// Apply save completion after every edit-producing poll. This makes the
// generation check below cover compute results that arrived this frame.
Expand Down Expand Up @@ -648,19 +650,12 @@ fn main() -> eframe::Result<()> {
} else {
DEFAULT_WINDOW_PT
};
#[allow(unused_mut)]
let mut viewport = egui::ViewportBuilder::default()
let viewport = egui::ViewportBuilder::default()
.with_inner_size(inner)
.with_min_inner_size([720.0, 460.0])
.with_title("PlotX")
.with_icon(application_icon());
// Windows and Linux draw a VS Code style title bar (logo + menus + window
// controls) inside the content area; macOS keeps the native title bar and
// system menu.
#[cfg(not(target_os = "macos"))]
{
viewport = viewport.with_decorations(false);
}
let viewport = ui::configure_ribbon_viewport(viewport);
let mut wgpu_options = eframe::egui_wgpu::WgpuConfiguration {
desired_maximum_frame_latency: desired_maximum_frame_latency(),
..Default::default()
Expand Down
17 changes: 7 additions & 10 deletions crates/app/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod primary_sidebar;
pub(crate) mod processing_templates;
pub(crate) mod properties;
mod ribbon;
mod ribbon_chrome;
mod secondary_sidebar;
mod settings_dialog;
mod shortcuts;
Expand All @@ -42,6 +43,9 @@ use plotx_core::actions::Action;
use plotx_core::export::{ExportPageScope, ExportScopeKind, ExportSettings};
use plotx_core::operation::OperationOutcome;
use plotx_core::state::{Interaction, PlotxApp, Selection};
pub(crate) use ribbon_chrome::{
RibbonChrome, configure_viewport as configure_ribbon_viewport, current as current_ribbon_chrome,
};
pub(crate) use settings_dialog::apply_chrome_theme;
use settings_dialog::{settings_window, sync_chrome_theme};
use shortcuts::*;
Expand All @@ -53,6 +57,7 @@ pub fn render(
batch_workflow: &mut batch_workflow::AutomationUi,
ui: &mut Ui,
input_blocked: bool,
ribbon_chrome: RibbonChrome,
) {
let ctx = ui.ctx().clone();
ctx.send_viewport_cmd(egui::ViewportCommand::Title(project_window_title(app)));
Expand Down Expand Up @@ -116,18 +121,10 @@ pub fn render(
});

egui::Panel::top("ribbon")
.frame(card_frame(
dark,
egui::Margin {
left: 8,
right: 8,
top: 4,
bottom: 4,
},
))
.frame(ribbon_chrome::frame(dark))
.show_separator_line(false)
.show_inside(ui, |ui| {
ribbon::render(app, clipboard_table_paste, ui);
ribbon::render(app, clipboard_table_paste, ui, ribbon_chrome);
});

feedback_banner(app, ui, dark);
Expand Down
Loading
Loading