mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-27 13:28:28 +00:00
Use Path to extract file name.
This commit is contained in:
parent
02b8c13174
commit
126d5184f6
@ -6,7 +6,7 @@ use glium::{Display, Surface};
|
|||||||
use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, Ui};
|
use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, Ui};
|
||||||
use imgui_glium_renderer::Renderer;
|
use imgui_glium_renderer::Renderer;
|
||||||
use imgui_winit_support::{HiDpiMode, WinitPlatform};
|
use imgui_winit_support::{HiDpiMode, WinitPlatform};
|
||||||
use std::path::MAIN_SEPARATOR;
|
use std::path::Path;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
mod clipboard;
|
mod clipboard;
|
||||||
@ -21,8 +21,8 @@ pub struct System {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(title: &str) -> System {
|
pub fn init(title: &str) -> System {
|
||||||
let title = match title.rfind(MAIN_SEPARATOR) {
|
let title = match Path::new(&title).file_name() {
|
||||||
Some(idx) => title.split_at(idx + 1).1,
|
Some(file_name) => file_name.to_str().unwrap(),
|
||||||
None => title,
|
None => title,
|
||||||
};
|
};
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user