From 5d8b35d43c60262ae97dcad47264ce9b36617143 Mon Sep 17 00:00:00 2001 From: Jort van Waes Date: Wed, 20 Sep 2023 13:02:16 +0200 Subject: [PATCH] Added a program icon. Changed the window title to Mandelbrot by Jort + the version. Release of v1.5 --- icons/rust.ico | Bin 0 -> 67646 bytes src/lib.rs | 9 ++++++--- src/view/minifb_mandelbrot_view.rs | 26 +++++++++++++++++++++----- 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 icons/rust.ico diff --git a/icons/rust.ico b/icons/rust.ico new file mode 100644 index 0000000000000000000000000000000000000000..8a8f98d9c594ea6e9a4e397baa045736bc2b09fa GIT binary patch literal 67646 zcmeI437BR@dGEiT3=RWcnPCw@kY*F2QQV@BA}}BU6ctnyS7h^|#w8jr=4!YMNUjt0 zCKH!yjE~+?jKLixYTS@bMG1>&T!R=TfJBWVZm9JA|IRtT>6$a&+Wj@%J?WR{f2!W9 zx88b}syfTpL#H#5|JJVUEIDfr*k*#QZeQT5MSco&WY35e%Ca7CorF1Nu6U5 zDsyBm-=214f75{a-v*E}Wqp@0Uk}v(&D6I>Afyd7H+`iYUFH1Ky-T%05h&wEz2qHh zu8vCsx%qVi>R$-%7C?+u_K4K!|6Nm3zoV(INePvCTOIz2K>fEj^~a}#)LV1)wQX-V z+e`VS`lbBlFSV^Np-JN;%t} z7a0g!JTp#7o%aglwf*l?hxD!HmahFGa8){qA!jr3_KZF^_3Z-5eP(}|C&%07-j(lG zmNLC`n*U2QBIT;!-GOtKHh-~^Te=6-dw_GY+g>m}JEs4~O)Sj^rDrtH;wJ|02<-2c zOWVi=7)BNu3!P3V0_#4jY}v@|Lu@X7w>m8;MvD6VH&19a~tX?K?bv+phl) zPFt^-xASO>d&$pbdpS3CY%Aw0`|p=NNFUq2*S*uRkl#{Db9_)7dTnrIV4Jba>La(70F4cId1UU6(>Al7?(%|9k>#KiAP#wAT#1i9uP5^p@i$<03p z&j@^$Gynf9ZSX(|%*{qrkXOZV7OmlpDl&&e}1>BRn!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|x;qbdL-FTM%YTjmYbG7Pd|B8#-Zag>=S=%|zBxj5{~BtO%aK}^{yX4f z(T)W_(V3d+tliju`10+hrf!?ur;?vq(^)fd$kfztHyqYszNr&Cuc;ghzdY>ZWM`Y2 ze|l$m8jhaq9A5G3(|>LHGuyU|Tc3A~^smXh6@N`C%W89WpughJtoked@~S`6P{SX2 zOU-ufzox1jfAOaLYY*L&Kf5-g)4BiJs$=yU`)ht#U35BsP*)~4=Xc2S;IgUvb*g_L zpZ--7;rYYDi5waeYifQf9~CC@aJg(lXXi>jc1}DzOZM2#eii@v^qo=lS3ED0%l>?A zXRA}2{`EC~@Ab(`a;P9qD?c`Rx2ZmeC_6r#pW`CjLAyd&l*j=7~StlwWp!_{*o| zw|aiQ8M~j-yiMjh+Wi)O$BVMx5+`Zj^RgeaU!^x3oBdkt@2X|l{gaD=zw33?{+{ei zoXK{dddDl)cJ5N0Cu=MDZL?(S^W@lyKl4lBtMg>vN`C5H^rL_KoMvZEO(k5>fAnN$ z>(5Tzyx-LCR@LX#WM|niQ`f$B>eft`{tTGdVd}hnr!KFit0p{r>e%h4_NvrX2iU3$ zH>^Bk>uS1+U%u0tVB|%L-?(#`@s~|nvb?n#ZRVjt7(4Onu6ay_0Wz@|N3<`@BM1C``LMQzxTV} k+)&>SA9j7Mf2wuAoNC`s+xOee?#HeB^;GMAUf%EjKWq8@DF6Tf literal 0 HcmV?d00001 diff --git a/src/lib.rs b/src/lib.rs index 8be60e9..7914d0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,6 +51,12 @@ static COLORING_FUNCTION: ColoringFunction = TrueColor::new_from_bernstein_polyn //Color channel mapping static COLOR_CHANNEL_MAPPING: ColorChannelMapping = ColorChannelMapping::RGB; +//Window title +static WINDOW_TITLE: &str = "Mandelbrot by Jort"; + +//Banner values +static VERSION: &str = "1.5"; + //Views static VIEW_1: View = View::new(-0.6604166666666667, 0.4437500000000001, 0.1); static VIEW_2: View = View::new(-1.0591666666666668, 0.2629166666666668, 0.01); @@ -63,9 +69,6 @@ static VIEW_8: View = View::new(-1.7862581627050718, 0.00005198056959995248, 0.0 static VIEW_9: View = View::new(-0.4687339999999999, 0.5425518958333333, 0.000010000000000000003); static VIEW_0: View = View::new(-0.437520465811966, 0.5632133750000006, 0.000004000000000000004); -//Banner values -static VERSION: &str = "1.4"; - ///Holds all the logic currently in the main function that isn't involved with setting up configuration or handling errors, to make `main` concise and ///easy to verify by inspection /// # Panics diff --git a/src/view/minifb_mandelbrot_view.rs b/src/view/minifb_mandelbrot_view.rs index 6f7d31b..b5ab171 100644 --- a/src/view/minifb_mandelbrot_view.rs +++ b/src/view/minifb_mandelbrot_view.rs @@ -1,6 +1,8 @@ -use minifb::{Key, Window, WindowOptions}; +use std::str::FromStr; -use crate::model::mandelbrot_model::MandelbrotModel; +use minifb::{Icon, Key, Window, WindowOptions}; + +use crate::{model::mandelbrot_model::MandelbrotModel, VERSION, WINDOW_TITLE}; pub struct MandelbrotView { pub window: Window, @@ -9,15 +11,29 @@ pub struct MandelbrotView { impl MandelbrotView { pub fn new(mandelbrot_model: &MandelbrotModel) -> MandelbrotView { // Create a new window - let window = Window::new( - "Mandelbrot set viewer", + let mut window = Window::new( + &format!("{} v{}", WINDOW_TITLE, VERSION), mandelbrot_model.config.window_width, mandelbrot_model.config.window_height, - WindowOptions::default(), + WindowOptions { + borderless: false, + title: true, + resize: true, + scale: minifb::Scale::X1, + scale_mode: minifb::ScaleMode::Center, + topmost: false, + transparency: false, + none: false, + }, ) .unwrap_or_else(|e| { panic!("{}", e); }); + //Set window background color to darkgray + window.set_background_color(27, 27, 27); + + #[cfg(target_os = "windows")] + window.set_icon(Icon::from_str("icons/rust.ico").unwrap()); //Print info about the MandelbrotModel mandelbrot_model.p.pixel_plane.print();