From 5083db8d44cfbce7d20649ce32a15477202336e0 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 24 Mar 2021 12:00:05 +0100 Subject: [PATCH 01/12] On new install or update, have highlights not just changelog. Place images in resources/images/whats_new/N.format and texts in resources/texts/whats_new/N.format where N is the ordinal and format the respective allowed formats. CURA-8014 --- cura/UI/WhatsNewPagesModel.py | 79 +++++++- resources/images/whats_new/0.png | Bin 0 -> 1935 bytes resources/images/whats_new/1.png | Bin 0 -> 2072 bytes resources/images/whats_new/2.png | Bin 0 -> 1958 bytes .../qml/WelcomePages/ChangelogContent.qml | 59 ++++++ .../qml/WelcomePages/WhatsNewContent.qml | 179 +++++++++++++++--- resources/qml/Widgets/ScrollableTextArea.qml | 7 +- resources/texts/whats_new/0.html | 5 + resources/texts/whats_new/1.html | 2 + resources/texts/whats_new/2.html | 2 + 10 files changed, 307 insertions(+), 26 deletions(-) create mode 100644 resources/images/whats_new/0.png create mode 100644 resources/images/whats_new/1.png create mode 100644 resources/images/whats_new/2.png create mode 100644 resources/qml/WelcomePages/ChangelogContent.qml create mode 100644 resources/texts/whats_new/0.html create mode 100644 resources/texts/whats_new/1.html create mode 100644 resources/texts/whats_new/2.html diff --git a/cura/UI/WhatsNewPagesModel.py b/cura/UI/WhatsNewPagesModel.py index 5b968ae574..afba295e90 100644 --- a/cura/UI/WhatsNewPagesModel.py +++ b/cura/UI/WhatsNewPagesModel.py @@ -1,8 +1,12 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. - from .WelcomePagesModel import WelcomePagesModel +import os +from typing import Optional, Dict, List, Tuple +from PyQt5.QtCore import pyqtProperty, pyqtSlot +from UM.Logger import Logger +from UM.Resources import Resources # # This Qt ListModel is more or less the same the WelcomePagesModel, except that this model is only for showing the @@ -10,13 +14,84 @@ from .WelcomePagesModel import WelcomePagesModel # class WhatsNewPagesModel(WelcomePagesModel): + image_formats = [".png", ".jpg", ".jpeg", ".gif", ".svg"] + text_formats = [".txt", ".htm", ".html"] + image_key = "image" + text_key = "text" + + @classmethod + def _collectOrdinalFiles(cls, resource_type: int, include: List[str]) -> Tuple[Dict[int, str], int]: + result = {} # Dict[int, str] + highest = -1 + try: + folder_path = Resources.getPath(resource_type, "whats_new") + for _, _, files in os.walk(folder_path): + for filename in files: + basename = os.path.basename(filename) + base, ext = os.path.splitext(basename) + if ext not in include or not base.isdigit(): + continue + page_no = int(base) + highest = max(highest, page_no) + result[page_no] = os.path.join(folder_path, filename) + except FileNotFoundError: + Logger.logException("w", "Could not find 'whats_new' folder for resource-type {0}".format(resource_type)) + return result, highest + + @classmethod + def _loadText(cls, filename: str) -> str: + result = "" + try: + with open(filename, "r", encoding="utf-8") as file: + result = file.read() + except OSError: + Logger.logException("w", "Could not open {0}".format(filename)) + return result + def initialize(self) -> None: self._pages = [] self._pages.append({"id": "whats_new", "page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"), + "next_page_button_text": self._catalog.i18nc("@action:button", "Skip"), + "next_page_id": "changelog" + }) + self._pages.append({"id": "changelog", + "page_url": self._getBuiltinWelcomePagePath("ChangelogContent.qml"), "next_page_button_text": self._catalog.i18nc("@action:button", "Close"), }) self.setItems(self._pages) + images, max_image = WhatsNewPagesModel._collectOrdinalFiles(Resources.Images, WhatsNewPagesModel.image_formats) + texts, max_text = WhatsNewPagesModel._collectOrdinalFiles(Resources.Texts, WhatsNewPagesModel.text_formats) + highest = max(max_image, max_text) + + self._subpages = [] # List[Dict[str, str]] + for n in range(0, highest + 1): + self._subpages.append({ + WhatsNewPagesModel.image_key: None if n not in images else images[n], + WhatsNewPagesModel.text_key: None if n not in texts else self._loadText(texts[n]) + }) + if len(self._subpages) == 0: + self._subpages.append({WhatsNewPagesModel.text_key: "~ There Is Nothing New Under The Sun ~"}) + + def _getSubpageItem(self, page: int, item: str) -> Optional[str]: + if 0 <= page < self.subpageCount and item in self._subpages[page]: + return self._subpages[page][item] + else: + return None + + @pyqtProperty(int, constant = True) + def subpageCount(self) -> int: + return len(self._subpages) + + @pyqtSlot(int, result = str) + def getSubpageImageSource(self, page: int) -> str: + result = self._getSubpageItem(page, WhatsNewPagesModel.image_key) + return "file:///" + (result if result else Resources.getPath(Resources.Images, "cura-icon.png")) + + @pyqtSlot(int, result = str) + def getSubpageText(self, page: int) -> str: + result = self._getSubpageItem(page, WhatsNewPagesModel.text_key) + return result if result else "* * *" __all__ = ["WhatsNewPagesModel"] diff --git a/resources/images/whats_new/0.png b/resources/images/whats_new/0.png new file mode 100644 index 0000000000000000000000000000000000000000..b2b56a3bf20f0e85422a6ce2729cbb80b276cead GIT binary patch literal 1935 zcmb`Ic~sKr8pnZtD!Fj6F>}d{oUGJzBF%;rWlTj&&1o@H6xVbl8FynuBB8X*lNqTY zR%T|o;4W^F3Cd){;2=llIUX`b%R zYRWpwAP`6m>*DAI0)g%2`x+=jK1a|4o#YER#>*K4D(~JsEf0V&hm#HAgKEL8|4bH$ zGf|;{p{hsSQfRD#={J&`xD-o>V(Pc<|1U>DQO5X$FXL8)3oR*|<2MZh1>-J2X>eYk zbD?-%o&9XNQSW*V@6}vt;N`KE+@N#KGS3tAoi;WP+j-R8(6fSG8fTfd_O#cT>i|V( z%^TpY)!AV__=~o~W`+R;jzJG5iEy^TJ=0vG;!I{rD4eZ?L`uU4QIPnV=&`&KESi*p zFb6(&t9r!htk5WWxoi8~c{n&*MLT!&@MnE+@xh<_^5}Yd1hFAROds0~U_Rozhv>x9 zDScTB*b}@cSR$C^Z1Rb>7J9mVcUZc(qIWhEwi19kkwf^C}lCb9SwXGkHRGZ~P znapgs8ssB4>N9b*Dz#rscOu2ZC3dH z*LN55qEv5NoKwC_qSc~~E~$wdx|UxJ`h35WJWHr8MEf89S5V`|DRNx$U-j2$3NfEF z)I8|AO+7i6l2`i*X8`F+ENu0DrgfgQ?kIg9gq2=DRj((BWJ>f-COmw1bLE-A^NJ=> z?@reC3yxgsWvP3^Jgj#R9W!AWX(Z@O^1(Jr$M4{fb%g`--6h&hFA(#JuzIbVSk)n?nA;`)B0V1n6;gS&!;x?U))(g&Qq2A^4Xsa?J^25db^<2 z71ioHlal)Z@U>{m(Ff1kWMnnRpDE9VMbuBUa?X&3HfJ*K!C0EFMXS!?GRg9`W4^~d zGASmL;`KGZU?*Ogo!>Kpre?Zm9?hYlihRmyB4F20=?&@q818|_vYybxr;BQ=gg>5T{C8!u7VxFv@GYNAYOf|0DE`|?|I8Ou z($-o-{_9;tR3JR`$U>=E?y6=kG<8xSr)d<>-Hgz0i}o+TGd!rYQ`zy zs#BK*Ipya>AcJz|qvoZ&x0V?jp~>(3@|&c)DoKS?}Sy(v>WOQ~O7C>F zKg0h5)Z6pd*3gQ{=%Quo_#k|0I;B`h_wpf@Zl3sMCN6UeL!BpEkp{OswVy*}mu(`cg^8_QtVy3&73 zR(5OAw*UVy|397PAO6s7ZrKOgUi$5Kszjo{6dGixysNiDwd73{ggx%=SdIyx{tejG BaJ2vc literal 0 HcmV?d00001 diff --git a/resources/images/whats_new/1.png b/resources/images/whats_new/1.png new file mode 100644 index 0000000000000000000000000000000000000000..8d61045b400dc613f8827c80f06eb0bb1ca05d6a GIT binary patch literal 2072 zcmeAS@N?(olHy`uVBq!ia0y~yU~~Yow{S24$*i^{Hz37W9OUlAuiND@NRoc?EIvFmEX-xz*FJSik>%O;V4k zETi$Y3YIewj|B~qd)*K8n93mweE;0=pE01vb(V6%0`_hb_X7_6VwrsnjdD7dWEh!k zBbHb)u~lvGC}!dLk}&ZZhs2A6N@oQPE;J962J>(C8Gp@pkOw)^I30v)_VhBc(^pH9qKptB1UwU(*;?cC7^bo>LM5YNhA z#f7XOKZ^%Tu6^NuJO*Uw`Xvfdm-r93fY}TAW?k+-C<0>ZFZdkaR3~&U9cXBUR_x!R zFP{t4K$<_lxFNn&zVk9DsOGt(?=$%uGUqVRwhug3AFLP1_XvX|?B@FY&U=xbYy#5p z{8He3$-fmmsX(KCxL7^ky~Mwv5ES0?UE6K$f4;u_zR&-ql3x@JIzSE$e$k>{U03=4 z-26-5KP>wHN#vJ|#KHMSZU-K}tXTf**T;wP)ko&%=N&NrrD1UfB;NcoN4=`*&!2DY z;(wklW3O54-<O4|MUF*S_hzqYHl0?d8qw`oceFY2iy7M z?d+ca?{Ap?6r}%eNzdn6;Sc67m&pMwRDN_7+*}0v|SkO_-dwVU8cr#Oz0+V1E0$^-4@} z(?DMMe&K7V%YoBiC(G^H*Tqp0`EQCL(>>?w;enfh!Q}f<9nAMB4;Nw7KMivG?3eGl zlpdsl1J(F$Y#`K8`O9`|cR?*bTT<>S2(^6XyLB2+%gis|6?KJLmbPp6BA8`phQAX3 z(7R8k4rS3yu>{;~TT&%z${isuvi<=mE^JF`MPXjR5ng^)2Z~@` z@MMqhTi);D&1Yp)of_l$YsR`(Zbb(RNQ z_`Vs5GGAMM&=6#?oPTuK1cy{ z22lWc9p5MO*JjR1kWs89U%fB*ANmO@TH>9b-=9;*vkX*}*Ql0Wm|Vx41}ZCS46k13 z`d4xWR2J=EnHo6nUrY?Bh%ZoFwFF*P7KQjo{@Pq%3bL(KbHVEu?;UtSW#Z~!AK{ns zJxL%7$`>8-TTsuywHavWovEj+9sWCK90IvwmPd&#Nb#VpQt;Mtzbg;)Y!p*YI40HK sAen8$l(yz0$Bd1~kOkh}tNA5=`M}W{HycwsU~SIe>FVdQ&MBb@0QfJZxc~qF literal 0 HcmV?d00001 diff --git a/resources/images/whats_new/2.png b/resources/images/whats_new/2.png new file mode 100644 index 0000000000000000000000000000000000000000..3220bd29a9537fcc98f093a73d37e698f59ce100 GIT binary patch literal 1958 zcmbuAS5(sp7RK`r5du;YX#paG1VzUK0ucxjM2ZBE5Eq1i0tui7loA$&7%8C_Dat6l z=rDkLXhB8-(n4Pq3`HO#LklC366syY;_jY(n6q#5aLae^J@@hZC0(`0Nl7S6fIuKA z8*57k5D2(**#8OzALcvpURH+%2zJ1kgQ`9t=MDvgVum*Zfojr^e)BwXsKu$)uE8LX zbjSAqdIDeG1cAhiZ7j{M(L4m>HGz&eP|r&L8C8>LpVOI5Pb1YFUPkM=EX!OoSGSgg zi=ZvUp(m^ndT2G#tHze^iXH>v@n)8f~ zcK@E$NSS>VIxM**G?Nhs?7+@>)8;%YKgV{!HK``It+6D{F))6~3pp(r>rL$Avo$5}ylVoL-KDrA~?-DTJ~d9n#bfM|DC zvXYV~0}8y;2@Ik3;}_&!!or(~qItV!s4EDY1@W>y~Ti#D^Ur z)xud$TU*(SowtgneWa$VH#}Yn>oKk5h(8pwbQ`*k>`z0gL%9?4O>`5kq0FQ6cPfXw zrGzJkm=YU4!Ju7zFk>jtLi~Ed= zhV*3!{>;5s!E5$qi zS+uGj*r}>L_=LQ`60S1+rC&rbjzcjlNtWg?DO81t!z@b$*nhd!(3*Ip6& zDzgc3o0Hr7HxU6fvgH+zYi&a*OSA8Jk-4+BGi~F$ti}rZzM!mt-?cv)(7L^|`(TYN zR!8ZJFL0TU7Z`SJ)Tw&VSHhc7{DsjX_fIam>GlSgsWpw`5I5WYpDyHWtl7>?@S2PY z$q{n_#kbN3_xd+z%GmZCrUj&;m{>p7&=SN7kS1IsY3Ign31=a;q5wyG*=|rPA3>bI zGV7CDLXtpjrP*-h!I>+Bflh9d&NN>7msEz6WMfh9fQ`1cozY&Z^iND#2)1~;ntboZWhUY1 zCKQ7b2-=N(hqDy>;2JQh0UcK@vD76SvY)aF#V9Ha1qwFrk8r%87#Rar``wROG@+{$ zz-P}p(<+B+JzHMGq~X-vH^vIA_B;8FZDYh}DCT~1agV}QoA<8#Wwx(Mfa&Y)V+y4t zS4h5IdDohoU^CFkzSXb$#~8-YEf%fthS9=?cK>oR!|_nny?IhXay#ZG3Y5JKSiz3c zx#Wds=fU<*1iXfz^sTB+IF)`=fpa>Y;n=}5It$5HP~ha8n0mTyIO>As$1#QmCgvA& zJA7TRWw8u`)*wgAUmJl;@>}UmV4s9jm3Q;flg}Y;uH>tN?SV&pKREN^`z~}AvLul~ zfe+>6edaaruB1(g19xlPu!e#9>P>$nhBDuw$hSrw@x@-W_`{;$%PH#FCN9_*#x0w3 zg*X>eV>5QH3w8zpaH`%ISw^h%t}jRc3x6YFJ5GSLOQLfuBfpPez}@Kr$~R8V=kle# zX<}i;4L7+oA*8W3=;1=l=k>;#>$i6+wX}9~n{y&4A(6$m(^|~g(h!MlcYgBl`i<)| zzb|pZ@KX?MZ4yu$8^SR2O;UVk^xZa@D!p29w4^XKG6nJ6ahXRm|L&(DNe^zTdniOg zxw@hYhBUJ#b@CSC6=~UF+luX>L&eeHV6tW=uC30+Dv@5`t?BIZo3z)wR6Jw<9rd(h zpfzOC-B~1;E`pkZ=_!qTR8a-QGQLffPT0bz7;%}P`AP{uOkep+QtHO~fz@?rJ@{=3 zZLksv5NBu;gR1)hGu2Kpcv*XwPWvJmxbyOEvkHq%2a*C+|=wJeWgp!GiFSvs~K zH_}_(k;|l`FZ~Z5e;EjWrqO>N=6&1v8Kj{j@+VgPXZz3Gygfy2bW)mHot New Feature (1/2) +

+ Lorem ipsum et cetera ad infinitum dolce et gabana carpe diem.
+ Link to EXAMPLE. +

diff --git a/resources/texts/whats_new/1.html b/resources/texts/whats_new/1.html new file mode 100644 index 0000000000..2229c9d0d3 --- /dev/null +++ b/resources/texts/whats_new/1.html @@ -0,0 +1,2 @@ +

Hot New Feature (2/2)

+

Pa's wijze lynx bezag vroom het fikse aquaduct.

diff --git a/resources/texts/whats_new/2.html b/resources/texts/whats_new/2.html new file mode 100644 index 0000000000..1260befcb5 --- /dev/null +++ b/resources/texts/whats_new/2.html @@ -0,0 +1,2 @@ +

The other thing we wanted to tell you!

+

The quick brown fox jumps over the lazy dog.

From b04bbfdee2160aa125825d0a8096c435b783403c Mon Sep 17 00:00:00 2001 From: Remco Burema <41987080+rburema@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:57:41 +0100 Subject: [PATCH 02/12] Adopt code-review remark. Co-authored-by: Jaime van Kessel --- resources/qml/WelcomePages/ChangelogContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 89b9e746e8..d3eebe72e4 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 From d033e066f788bfafcbb7ebc3e901dedf080676cc Mon Sep 17 00:00:00 2001 From: Remco Burema <41987080+rburema@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:58:44 +0100 Subject: [PATCH 03/12] Adopt code-review remark. Use width instead of implicit width. Co-authored-by: Jaime van Kessel --- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index ee08999b94..b60e952145 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -152,7 +152,7 @@ Item delegate: Rectangle { - implicitWidth: UM.Theme.getSize("thin_margin").width + width: UM.Theme.getSize("thin_margin").width implicitHeight: UM.Theme.getSize("thin_margin").height radius: width / 2 From 98ed2bc8b671724d4c0431ef523fdcc5fae31688 Mon Sep 17 00:00:00 2001 From: Remco Burema <41987080+rburema@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:59:22 +0100 Subject: [PATCH 04/12] Adopt code-review remark. Use height instead of implicit height. Co-authored-by: Jaime van Kessel --- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index b60e952145..a50f08ab4f 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -153,7 +153,7 @@ Item Rectangle { width: UM.Theme.getSize("thin_margin").width - implicitHeight: UM.Theme.getSize("thin_margin").height + height: UM.Theme.getSize("thin_margin").height radius: width / 2 color: From f95c09db371c580f3522e93aa4af873ccb8b87d7 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 24 Mar 2021 16:18:56 +0100 Subject: [PATCH 05/12] Type-checks, not just type comments, and static- over class-method. CURA-8014 --- cura/UI/WhatsNewPagesModel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cura/UI/WhatsNewPagesModel.py b/cura/UI/WhatsNewPagesModel.py index afba295e90..990f10afd3 100644 --- a/cura/UI/WhatsNewPagesModel.py +++ b/cura/UI/WhatsNewPagesModel.py @@ -19,9 +19,9 @@ class WhatsNewPagesModel(WelcomePagesModel): image_key = "image" text_key = "text" - @classmethod - def _collectOrdinalFiles(cls, resource_type: int, include: List[str]) -> Tuple[Dict[int, str], int]: - result = {} # Dict[int, str] + @staticmethod + def _collectOrdinalFiles(resource_type: int, include: List[str]) -> Tuple[Dict[int, str], int]: + result = {} #type: Dict[int, str] highest = -1 try: folder_path = Resources.getPath(resource_type, "whats_new") @@ -38,8 +38,8 @@ class WhatsNewPagesModel(WelcomePagesModel): Logger.logException("w", "Could not find 'whats_new' folder for resource-type {0}".format(resource_type)) return result, highest - @classmethod - def _loadText(cls, filename: str) -> str: + @staticmethod + def _loadText(filename: str) -> str: result = "" try: with open(filename, "r", encoding="utf-8") as file: @@ -65,7 +65,7 @@ class WhatsNewPagesModel(WelcomePagesModel): texts, max_text = WhatsNewPagesModel._collectOrdinalFiles(Resources.Texts, WhatsNewPagesModel.text_formats) highest = max(max_image, max_text) - self._subpages = [] # List[Dict[str, str]] + self._subpages = [] #type: List[Dict[str, str]] for n in range(0, highest + 1): self._subpages.append({ WhatsNewPagesModel.image_key: None if n not in images else images[n], From f1cbe1a9587dcbe88c8867e046c41ae8543fde48 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 24 Mar 2021 16:29:38 +0100 Subject: [PATCH 06/12] ... and fix typing as a result of the last commit. CURA-8014 --- cura/UI/WhatsNewPagesModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/UI/WhatsNewPagesModel.py b/cura/UI/WhatsNewPagesModel.py index 990f10afd3..db0f4b3a74 100644 --- a/cura/UI/WhatsNewPagesModel.py +++ b/cura/UI/WhatsNewPagesModel.py @@ -65,7 +65,7 @@ class WhatsNewPagesModel(WelcomePagesModel): texts, max_text = WhatsNewPagesModel._collectOrdinalFiles(Resources.Texts, WhatsNewPagesModel.text_formats) highest = max(max_image, max_text) - self._subpages = [] #type: List[Dict[str, str]] + self._subpages = [] #type: List[Dict[str, Optional[str]]] for n in range(0, highest + 1): self._subpages.append({ WhatsNewPagesModel.image_key: None if n not in images else images[n], From 7304226aca377c2a109f9bf6e92b0d8793793c72 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 24 Mar 2021 16:44:58 +0100 Subject: [PATCH 07/12] Increase reliance on anchors instead of width-height. CURA-8014 --- .../qml/WelcomePages/WhatsNewContent.qml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index a50f08ab4f..ca8c758620 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -45,12 +45,12 @@ Item { top: topSpacer.bottom bottom: whatsNewDots.top + left: parent.left + right: parent.right horizontalCenter: parent.horizontalCenter - margins: UM.Theme.getSize("default_margin").width + margins: UM.Theme.getSize("default_margin").width * 2 } - height: parent.height - (UM.Theme.getSize("default_margin").height * 2) - width: parent.width - (UM.Theme.getSize("default_margin").width * 2) color: UM.Theme.getColor("viewport_overlay") StackLayout @@ -60,11 +60,11 @@ Item anchors { top: parent.top + topMargin: UM.Theme.getSize("default_margin").width horizontalCenter: parent.horizontalCenter - margins: UM.Theme.getSize("default_margin").width / 2 } - height: parent.height - (UM.Theme.getSize("default_margin").height * 2) - width: parent.width - (UM.Theme.getSize("default_margin").width * 2) + height: parent.height + width: parent.width currentIndex: whatsNewDots.currentIndex @@ -72,9 +72,9 @@ Item { anchors { - horizontalCenter: parent.horizontalCenter top: parent.top - margins: UM.Theme.getSize("default_margin").width / 2 + topMargin: UM.Theme.getSize("default_margin").width / 2 + horizontalCenter: parent.horizontalCenter } model: manager.subpageCount @@ -83,9 +83,9 @@ Item { anchors { - horizontalCenter: parent.horizontalCenter top: parent.top - margins: UM.Theme.getSize("default_margin").width / 2 + topMargin: UM.Theme.getSize("default_margin").width / 2 + horizontalCenter: parent.horizontalCenter } color: UM.Theme.getColor("viewport_overlay") @@ -100,7 +100,7 @@ Item topMargin: UM.Theme.getSize("default_margin").width } width: parent.width - (UM.Theme.getSize("default_margin").width * 2) - height: (parent.height - (UM.Theme.getSize("default_margin").width * 2)) * 0.8 + height: (parent.height - UM.Theme.getSize("default_margin").height) * 0.75 fillMode: Image.PreserveAspectFit source: manager.getSubpageImageSource(index) From 55cb7f88a7744833eec3a6e20701bab613ec73cb Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Thu, 25 Mar 2021 12:47:07 +0100 Subject: [PATCH 08/12] Change bottom left button text to "Skip" Or else the page shows two buttons "Next" buttons. CURA-8014 --- cura/UI/WelcomePagesModel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index b816833d67..3fdcebe0a0 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -241,6 +241,7 @@ class WelcomePagesModel(ListModel): }, {"id": "whats_new", "page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"), + "next_page_button_text": self._catalog.i18nc("@action:button", "Skip"), }, {"id": "data_collections", "page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"), From 7af6ea5cc54f6ad2b8486fbc30af56ce30af3e99 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Thu, 25 Mar 2021 12:51:07 +0100 Subject: [PATCH 09/12] Remove unnecessary horizontalCenter anchor Left and right anchors can't work at the same time with the horizontalCenter. In this case it makes more sence to remove the horizontalCenter, since the left and right ones also define the width of the rectangle. CURA-8014 --- resources/qml/WelcomePages/WhatsNewContent.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index ca8c758620..c5f061ed6a 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -47,7 +47,6 @@ Item bottom: whatsNewDots.top left: parent.left right: parent.right - horizontalCenter: parent.horizontalCenter margins: UM.Theme.getSize("default_margin").width * 2 } From 179d77ef5cc3ee1608fa7f17c7a40fc7bacc4f4f Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Thu, 25 Mar 2021 13:29:17 +0100 Subject: [PATCH 10/12] Transfer the "What's new" and "Changelog" pages at the end of wizard To match the requirements specified in the ticket. CURA-8014 --- cura/UI/WelcomePagesModel.py | 16 ++++++++++------ .../qml/WelcomePages/AddCloudPrintersView.qml | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index 3fdcebe0a0..3c2d0503ab 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -239,10 +239,6 @@ class WelcomePagesModel(ListModel): {"id": "user_agreement", "page_url": self._getBuiltinWelcomePagePath("UserAgreementContent.qml"), }, - {"id": "whats_new", - "page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"), - "next_page_button_text": self._catalog.i18nc("@action:button", "Skip"), - }, {"id": "data_collections", "page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"), }, @@ -260,13 +256,21 @@ class WelcomePagesModel(ListModel): }, {"id": "add_cloud_printers", "page_url": self._getBuiltinWelcomePagePath("AddCloudPrintersView.qml"), - "is_final_page": True, # If we end up in this page, the next button will close the dialog - "next_page_button_text": self._catalog.i18nc("@action:button", "Finish"), + "next_page_button_text": self._catalog.i18nc("@action:button", "Next"), + "next_page_id": "whats_new", }, {"id": "machine_actions", "page_url": self._getBuiltinWelcomePagePath("FirstStartMachineActionsContent.qml"), "should_show_function": self.shouldShowMachineActions, }, + {"id": "whats_new", + "page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"), + "next_page_button_text": self._catalog.i18nc("@action:button", "Skip"), + }, + {"id": "changelog", + "page_url": self._getBuiltinWelcomePagePath("ChangelogContent.qml"), + "next_page_button_text": self._catalog.i18nc("@action:button", "Finish"), + }, ] pages_to_show = all_pages_list diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index 32e6ffec39..524bf288a0 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -215,7 +215,7 @@ Item id: finishButton anchors.right: parent.right anchors.bottom: parent.bottom - text: catalog.i18nc("@button", "Finish") + text: base.currentItem.next_page_button_text onClicked: { discoveredCloudPrintersModel.clear() From 839ac63241c64993638debcb907381c1c99745fd Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 25 Mar 2021 15:26:24 +0100 Subject: [PATCH 11/12] Darker inactive dots in Whats New. CURA-8014 --- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index c5f061ed6a..c9c19f1bb0 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -158,7 +158,7 @@ Item color: index === whatsNewViewport.currentIndex ? UM.Theme.getColor("primary") : - UM.Theme.getColor("viewport_overlay") + UM.Theme.getColor("secondary_button_shadow") } } From 4e80ac5138021f9d8ca06fd5833bbf535ae0b5dd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 25 Mar 2021 15:53:08 +0100 Subject: [PATCH 12/12] Use alignment instead of anchors Since it's within a layout, you can't use anchors CURA-8014 --- resources/qml/WelcomePages/WhatsNewContent.qml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index c9c19f1bb0..68be6379d6 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -80,12 +80,7 @@ Item Rectangle { - anchors - { - top: parent.top - topMargin: UM.Theme.getSize("default_margin").width / 2 - horizontalCenter: parent.horizontalCenter - } + Layout.alignment: Qt.AlignHCenter color: UM.Theme.getColor("viewport_overlay") Image