From f6565c30170be239a4de21ff186b77d5a9deeee8 Mon Sep 17 00:00:00 2001 From: "Ilia (Elyas) Sobolev" Date: Tue, 15 Dec 2020 13:01:04 +0300 Subject: [PATCH] Sketcher: Scalable constraint icons Rendering scalable icons from .svg The size of the icons is related to the font size of the constraints. Calculations and access to settings are collected in one place. Default based on system font size. And also Symbol for diameter and radius. --- src/Mod/Sketcher/Gui/Resources/Sketcher.qrc | 29 +----- .../icons/small/Constraint_Block_sm.xpm | 23 ----- .../icons/small/Constraint_Concentric_sm.xpm | 64 ------------- .../icons/small/Constraint_EqualLength_sm.xpm | 27 ------ .../small/Constraint_ExternalAngle_sm.xpm | 94 ------------------ .../Constraint_HorizontalDistance_sm.xpm | 27 ------ .../icons/small/Constraint_Horizontal_sm.xpm | 22 ----- .../small/Constraint_InternalAngle_sm.xpm | 75 --------------- .../icons/small/Constraint_Length_sm.xpm | 48 ---------- .../icons/small/Constraint_Lock_sm.xpm | 96 ------------------- .../icons/small/Constraint_Parallel_sm.xpm | 27 ------ .../small/Constraint_Perpendicular_sm.xpm | 26 ----- .../icons/small/Constraint_PointOnEnd_sm.xpm | 65 ------------- .../small/Constraint_PointOnMidPoint_sm.xpm | 60 ------------ .../small/Constraint_PointOnObject_sm.xpm | 59 ------------ .../small/Constraint_PointOnPoint_sm.xpm | 25 ----- .../small/Constraint_PointOnStart_sm.xpm | 63 ------------ .../small/Constraint_PointToObject_sm.xpm | 55 ----------- .../icons/small/Constraint_Radius_sm.xpm | 62 ------------ .../icons/small/Constraint_SnellsLaw_sm.xpm | 59 ------------ .../icons/small/Constraint_Symmetric_sm.xpm | 71 -------------- .../small/Constraint_TangentToEnd_sm.xpm | 65 ------------- .../small/Constraint_TangentToStart_sm.xpm | 72 -------------- .../icons/small/Constraint_Tangent_sm.xpm | 64 ------------- .../small/Constraint_VerticalDistance_sm.xpm | 29 ------ .../icons/small/Constraint_Vertical_sm.xpm | 24 ----- .../Gui/Resources/icons/small/README.md | 47 --------- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 70 ++++++++------ src/Mod/Sketcher/Gui/ViewProviderSketch.h | 6 ++ 29 files changed, 49 insertions(+), 1405 deletions(-) delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_EqualLength_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_ExternalAngle_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_SnellsLaw_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm delete mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/README.md diff --git a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc index 03a33af692..6ef59d52a5 100644 --- a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc +++ b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc @@ -196,33 +196,6 @@ icons/pointers/Sketcher_Pointer_Slot.svg icons/pointers/Sketcher_Pointer_Trimming.svg - - icons/small/Constraint_Block_sm.xpm - icons/small/Constraint_Concentric_sm.xpm - icons/small/Constraint_EqualLength_sm.xpm - icons/small/Constraint_ExternalAngle_sm.xpm - icons/small/Constraint_HorizontalDistance_sm.xpm - icons/small/Constraint_Horizontal_sm.xpm - icons/small/Constraint_InternalAngle_sm.xpm - icons/small/Constraint_Length_sm.xpm - icons/small/Constraint_Lock_sm.xpm - icons/small/Constraint_Parallel_sm.xpm - icons/small/Constraint_Perpendicular_sm.xpm - icons/small/Constraint_PointOnEnd_sm.xpm - icons/small/Constraint_PointOnMidPoint_sm.xpm - icons/small/Constraint_PointOnObject_sm.xpm - icons/small/Constraint_PointOnPoint_sm.xpm - icons/small/Constraint_PointOnStart_sm.xpm - icons/small/Constraint_PointToObject_sm.xpm - icons/small/Constraint_Radius_sm.xpm - icons/small/Constraint_SnellsLaw_sm.xpm - icons/small/Constraint_Symmetric_sm.xpm - icons/small/Constraint_TangentToEnd_sm.xpm - icons/small/Constraint_TangentToStart_sm.xpm - icons/small/Constraint_Tangent_sm.xpm - icons/small/Constraint_VerticalDistance_sm.xpm - icons/small/Constraint_Vertical_sm.xpm - icons/splines/Sketcher_BSplineApproximate.svg icons/splines/Sketcher_BSplineComb.svg @@ -293,4 +266,4 @@ translations/Sketcher_zh-CN.qm translations/Sketcher_zh-TW.qm - + \ No newline at end of file diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm deleted file mode 100644 index ecdc6137ae..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * Constraint_Block_sm_xpm[] = { -"15 16 4 1", -" c None", -". c #CC0000", -"+ c #CA0000", -"@ c #CB0000", -" ...+. ", -" ......... ", -" ........... ", -" ..... ..... ", -" ..... ... ", -"...... ...", -"........ ...", -".. .... ...", -".. .... ...", -"@.. ........", -"... ......", -" ... ..... ", -" .... ..... ", -" ........... ", -" ........ ", -" .... "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm deleted file mode 100644 index 7577d4e32f..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm +++ /dev/null @@ -1,64 +0,0 @@ -/* XPM */ -static char * Constraint_Concentric_sm_xpm[] = { -"16 16 45 1", -" c None", -". c #B41414", -"+ c #CF1515", -"@ c #DB1515", -"# c #CE1515", -"$ c #B31313", -"% c #920E0E", -"& c #D71414", -"* c #8D0303", -"= c #540000", -"- c #550000", -"; c #8E0303", -"> c #CC0E0E", -", c #4D0000", -"' c #4F0000", -") c #910E0E", -"! c #660707", -"~ c #A41111", -"{ c #640707", -"] c #D71515", -"^ c #B41313", -"/ c #9A0E0E", -"( c #D31212", -"_ c #940404", -": c #990E0E", -"< c #8F0303", -"[ c #B21313", -"} c #450000", -"| c #460000", -"1 c #D91414", -"2 c #A51212", -"3 c #930404", -"4 c #DA1515", -"5 c #950404", -"6 c #A31111", -"7 c #D91515", -"8 c #D01515", -"9 c #650707", -"0 c #560000", -"a c #980E0E", -"b c #D61414", -"c c #500000", -"d c #CD0F0F", -"e c #4E0000", -"f c #570000", -" ", -" .+@@#$ ", -" %&*= -;&% ", -" %>, '>) ", -" &, !~~{ '] ", -" ^* /(__(: <[ ", -" += !(} |({ -+ ", -" 1 23 _~ 4 ", -" 4 ~_ 56 7 ", -" 8- !(| }(9 0+ ", -" $; :(55(a ;[ ", -" b' {669 c] ", -" %de 'd) ", -" %] c #CB1717", -", c #640808", -"' c #6F0909", -") c #D81616", -"! c #790101", -"~ c #770101", -"{ c #D81515", -"] c #700808", -"^ c #8F0C0C", -"/ c #D61717", -"( c #640000", -"_ c #4A0000", -": c #A01010", -"< c #8E0404", -"[ c #AA1212", -"} c #9E0404", -"| c #830C0C", -"1 c #D31717", -"2 c #B00808", -"3 c #4D0000", -"4 c #CD1515", -"5 c #5B0000", -"6 c #6A0808", -"7 c #C51616", -"8 c #C90E0E", -"9 c #D91515", -"0 c #B21313", -"a c #780101", -"b c #D91414", -"c c #8A0202", -"d c #D41111", -"e c #B91515", -"f c #CE1515", -"g c #580000", -"h c #860202", -"i c #D41212", -"j c #BB1515", -"k c #590606", -"l c #AD1212", -"m c #990404", -"n c #D61212", -"o c #BF1616", -"p c #D61616", -"q c #5D0000", -"r c #520000", -"s c #740707", -"t c #8C0303", -"u c #C70E0E", -"v c #790A0A", -"w c #D61414", -"x c #6F0000", -"y c #6B0000", -"z c #D51414", -"A c #7D0B0B", -"B c #CF1717", -"C c #900303", -"D c #740000", -"E c #6C0909", -"F c #740A0A", -"G c #A71212", -"H c #BB1616", -"I c #A81212", -"J c #770A0A", -" ", -" .+@#$ ", -" %&*=-=;>, ", -" ')! ~{] ^ ", -" /( _:)< ", -" [} |123 ", -" 45 678( ", -" 9 0{a ", -" b cde ", -" fg hijk ", -" lm hno ", -" pq rstu ", -" vwx yzA ", -" 6B8CDC8BE ", -" FGHIJ ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm deleted file mode 100644 index a557323341..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm +++ /dev/null @@ -1,27 +0,0 @@ -/* XPM */ -static char * Constraint_HorizontalDistance_sm_xpm[] = { -"16 16 8 1", -" c None", -". c #B01616", -"+ c #710B0B", -"@ c #DE1515", -"# c #B31616", -"$ c #DE1F1F", -"% c #B41616", -"& c #E61F1F", -" ", -" ", -" ", -" ", -" .+ +. ", -" @# #@ ", -" @# #@ ", -" @$..........$@ ", -" @@@@@@@@@@@@@@ ", -" @% %@ ", -" @# #@ ", -" &# #& ", -" ", -" ", -" ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm deleted file mode 100644 index 40b315dce2..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static char * Constraint_Horizontal_sm_xpm[] = { -"16 16 3 1", -" c None", -". c #E72020", -"+ c #DE1616", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" .++++++++++++. ", -" .++++++++++++. ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm deleted file mode 100644 index e6eb2b11f8..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm +++ /dev/null @@ -1,75 +0,0 @@ -/* XPM */ -static char * Constraint_InternalAngle_sm_xpm[] = { -"16 16 56 1", -" c None", -". c #5C0606", -"+ c #920C0C", -"@ c #760909", -"# c #C21515", -"$ c #D61313", -"% c #880303", -"& c #900C0C", -"* c #CB1616", -"= c #CB0F0F", -"- c #790101", -"; c #A51010", -"> c #D51616", -", c #DD1A1A", -"' c #920000", -") c #B31212", -"! c #D81616", -"~ c #A30606", -"{ c #550000", -"] c #8F0E0E", -"^ c #AF0909", -"/ c #C31616", -"( c #D71414", -"_ c #8E0303", -": c #CF1010", -"< c #C81414", -"[ c #DF1A1A", -"} c #6F0101", -"| c #D91414", -"1 c #5C0000", -"2 c #B90A0A", -"3 c #D21616", -"4 c #9C1010", -"5 c #D31212", -"6 c #AB0808", -"7 c #D41616", -"8 c #A91212", -"9 c #7E0909", -"0 c #BE0D0D", -"a c #4E0000", -"b c #A50707", -"c c #D71515", -"d c #A91111", -"e c #B81414", -"f c #820202", -"g c #9E0505", -"h c #DF1919", -"i c #B81313", -"j c #430000", -"k c #960505", -"l c #D81414", -"m c #B71313", -"n c #460000", -"o c #930404", -"p c #A90F0F", -"q c #6A0000", -" ", -" .+ ", -" @#$% ", -" &*=- ", -" ;>,' ", -" .)!~{]^ ", -" @/(_ : ", -" <[} | ", -" 1234 5 ", -" {678 90 ", -" abcdef ", -" aghi ", -" jklm ", -" no(p ", -" q ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm deleted file mode 100644 index 95b4ebb87c..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm +++ /dev/null @@ -1,48 +0,0 @@ -/* XPM */ -static char * Constraint_Length_sm_xpm[] = { -"16 16 29 1", -" c None", -". c #660606", -"+ c #9B1010", -"@ c #BA1616", -"# c #C91818", -"$ c #490202", -"% c #DB1E1E", -"& c #DA1111", -"* c #D20707", -"= c #CD0000", -"- c #BB1616", -"; c #7E0B0B", -"> c #DC1212", -", c #CC0000", -"' c #D51818", -") c #CF0303", -"! c #6A0606", -"~ c #D61818", -"{ c #CF0404", -"] c #DC1E1E", -"^ c #7D0B0B", -"/ c #6B0505", -"( c #DC1313", -"_ c #9A1010", -": c #BC1616", -"< c #480202", -"[ c #C81818", -"} c #9C1010", -"| c #6C0505", -" ", -" .+@# ", -" $%&*=- ", -" ;>,*+ ", -" ')>&! ", -" ~)~;% ", -" ~)~ $ ", -" ~{~ ", -" ~{~ ", -" $ ~)~ ", -" ]^~)~ ", -" /&()~ ", -" _*,(^ ", -" :=*&]< ", -" [-}| ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm deleted file mode 100644 index e58888d1f0..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm +++ /dev/null @@ -1,96 +0,0 @@ -/* XPM */ -static char * Constraint_Lock_sm_xpm[] = { -"16 16 77 1", -" c None", -". c #8B1515", -"+ c #BD1E1E", -"@ c #BB1F1F", -"# c #E82727", -"$ c #A51919", -"% c #A41919", -"& c #E62626", -"* c #B91E1E", -"= c #7B1111", -"- c #E12626", -"; c #530808", -"> c #540808", -", c #DE2424", -"' c #781010", -") c #8E1414", -"! c #8F1313", -"~ c #A21616", -"{ c #A61919", -"] c #750D0D", -"^ c #720B0B", -"/ c #A41717", -"( c #A51818", -"_ c #700A0A", -": c #A21717", -"< c #721010", -"[ c #AE1B1B", -"} c #B11C1C", -"| c #B01C1C", -"1 c #B01B1B", -"2 c #AC1A1A", -"3 c #AB1A1A", -"4 c #700F0F", -"5 c #B81D1D", -"6 c #CE1717", -"7 c #B80B0B", -"8 c #B70B0B", -"9 c #B70A0A", -"0 c #B60A0A", -"a c #B50A0A", -"b c #C61212", -"c c #B51C1C", -"d c #B61D1D", -"e c #C91414", -"f c #B50909", -"g c #B40909", -"h c #B30808", -"i c #C11010", -"j c #B31B1B", -"k c #C41111", -"l c #B30909", -"m c #B20808", -"n c #B10707", -"o c #B00707", -"p c #BC0D0D", -"q c #B11A1A", -"r c #B41B1B", -"s c #BF0F0F", -"t c #AF0606", -"u c #AE0606", -"v c #B01818", -"w c #BA0C0C", -"x c #AD0505", -"y c #AC0505", -"z c #AC0404", -"A c #AE1818", -"B c #B01A1A", -"C c #AB0404", -"D c #AA0404", -"E c #AA0303", -"F c #A90303", -"G c #AD1717", -"H c #760D0D", -"I c #B51A1A", -"J c #B41919", -"K c #B31919", -"L c #730D0D", -" ", -" .++. ", -" @#$%&* ", -" =-; >,' ", -" $) !~ ", -" {] ^/ ", -" (^ _: ", -" <[[}|11234 ", -" 5677890abc ", -" de0afgghij ", -" cklhmmnopq ", -" rsnoottu9v ", -" qwuuxxyzmA ", -" B0yCCDEFxG ", -" HIIIJJJKKL ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm deleted file mode 100644 index b61bb8acc6..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm +++ /dev/null @@ -1,27 +0,0 @@ -/* XPM */ -static char *Constraint_Parallel_sm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 5 1 ", -" c None", -". c #932F2F", -"+ c #AB2121", -"# c #CF0C0C", -"@ c #790A0A", -/* pixels */ -" . ", -" @## ", -" @##+ ", -" @##+ ", -" @##+ ", -" @##+ ", -" @##+ ++ ", -" @##+ +##@ ", -" @##+ +##@ ", -" @##+ +##@ ", -"@##+ +##@ ", -"@#+ +##@ ", -" . +##@ ", -" +#@ ", -" . ", -" " -}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm deleted file mode 100644 index 880d750cf3..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -static char * Constraint_Perpendicular_sm_xpm[] = { -"16 16 7 1", -" c None", -". c #BB1616", -"+ c #DE1515", -"@ c #BE1616", -"# c #CC0000", -"$ c #C01616", -"% c #E61F1F", -" ", -" ", -" .++. ", -" @##@ ", -" @##@ ", -" @##@ ", -" @##@ ", -" @##@ ", -" @##@ ", -" @##@ ", -" $##$ ", -" %+++++##+++++% ", -" +############+ ", -" %++++++++++++% ", -" ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm deleted file mode 100644 index 05f6689134..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm +++ /dev/null @@ -1,65 +0,0 @@ -/* XPM */ -static char * Constraint_PointOnEnd_sm_xpm[] = { -"16 16 46 1", -" c None", -". c #740909", -"+ c #AA1414", -"@ c #9A1010", -"# c #6A0707", -"$ c #900F0F", -"% c #D81111", -"& c #CE0202", -"* c #D20707", -"= c #CF1717", -"- c #E52222", -"; c #400000", -"> c #D21616", -", c #CC0000", -"' c #D20808", -") c #960F0F", -"! c #CF1919", -"~ c #D80E0E", -"{ c #DC1515", -"] c #D21515", -"^ c #B91515", -"/ c #670606", -"( c #D81414", -"_ c #CE0303", -": c #A51313", -"< c #D60C0C", -"[ c #DE1515", -"} c #D70D0D", -"| c #D81515", -"1 c #800C0C", -"2 c #C11616", -"3 c #720808", -"4 c #430000", -"5 c #810B0B", -"6 c #CF0404", -"7 c #D71515", -"8 c #D91515", -"9 c #8F0E0E", -"0 c #690707", -"a c #D21717", -"b c #B21515", -"c c #900E0E", -"d c #D40909", -"e c #CD1515", -"f c #E41C1C", -"g c #E21E1E", -" ", -" ", -" ", -" ", -" .+@ # ", -" $%&*= -; ", -" >,,,')!~{]^/ ", -" (,,,_:!<[}_|1 ", -" 2_,,%3 -45!67 ", -" 28>9 0 a_b ", -" cde ", -" fg ", -" ", -" ", -" ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm deleted file mode 100644 index 3dcbff1f24..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm +++ /dev/null @@ -1,60 +0,0 @@ -/* XPM */ -static char * Constraint_PointOnMidPoint_sm_xpm[] = { -"16 16 41 1", -" c None", -". c #660606", -"+ c #9B1010", -"@ c #BA1616", -"# c #C91818", -"$ c #490202", -"% c #DB1E1E", -"& c #DA1111", -"* c #D20707", -"= c #CD0000", -"- c #BB1616", -"; c #7E0B0B", -"> c #DC1212", -", c #CC0000", -"' c #D51818", -") c #CF0303", -"! c #6A0606", -"~ c #850C0C", -"{ c #C11616", -"] c #BE1515", -"^ c #910E0E", -"/ c #B60303", -"( c #D61818", -"_ c #D91010", -": c #D91111", -"< c #900E0E", -"[ c #BD1515", -"} c #BF1616", -"| c #840C0C", -"1 c #DC1E1E", -"2 c #7D0B0B", -"3 c #C01616", -"4 c #830C0C", -"5 c #6B0505", -"6 c #DC1313", -"7 c #9A1010", -"8 c #BC1616", -"9 c #480202", -"0 c #C81818", -"a c #9C1010", -"b c #6C0505", -" ", -" .+@# ", -" $%&*=- ", -" ;>,*+ ", -" ')>&! ", -" ~{]^/(;% ", -" ~_,,:< $ ", -" {,,,,] ", -" [,,,,} ", -" $ ^:,,:| ", -" 12(/<]34 ", -" 5&6)( ", -" 7*,62 ", -" 8=*&19 ", -" 0-ab ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm deleted file mode 100644 index 3f47eae239..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm +++ /dev/null @@ -1,59 +0,0 @@ -/* XPM */ -static char * Constraint_PointOnObject_sm_xpm[] = { -"16 16 40 1", -" c None", -". c #760A0A", -"+ c #A01111", -"@ c #AF1313", -"# c #9C1010", -"$ c #690808", -"% c #C21616", -"& c #D91515", -"* c #D21616", -"= c #8B0E0E", -"- c #991010", -"; c #D51616", -"> c #C80E0E", -", c #9C0505", -"' c #810101", -") c #9E0606", -"! c #AE0909", -"~ c #CE0202", -"{ c #CC0000", -"] c #D81111", -"^ c #7F0808", -"/ c #520000", -"( c #CE0303", -"_ c #A51313", -": c #D30808", -"< c #9B1010", -"[ c #CF1717", -"} c #850D0D", -"| c #840909", -"1 c #A41313", -"2 c #C81616", -"3 c #680000", -"4 c #D91414", -"5 c #6E0909", -"6 c #820C0C", -"7 c #BA0B0B", -"8 c #7B0A0A", -"9 c #BE0C0C", -"0 c #D61212", -"a c #730404", -" ", -" .+@@#$ ", -" %&*=-;>,'')! ", -" %~{{]^/ ", -" &{{{(_ ", -" *{{{:< ", -" =](:[ ", -" }|1- ", -" 23 ", -" 4 ", -" 5> ", -" 67 ", -" 89 ", -" 0 ", -" a ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm deleted file mode 100644 index 7f83b834d8..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static char *Constraint_PointOnPoint_sm_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1 ", -" c None", -". c #D71414", -"+ c #AA1919", -/* pixels */ -" ", -" + + ", -" +.+ +.+ ", -" +.+ +.+ ", -" + + ", -" ++++ ", -" +....+ ", -" +...++ ", -" +..+++ ", -" +.++.+ ", -" ++++ ", -" + + ", -" +.+ +.+ ", -" +.+ +.+ ", -" + + ", -" " -}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm deleted file mode 100644 index 2b13d25dc0..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm +++ /dev/null @@ -1,63 +0,0 @@ -/* XPM */ -static char * Constraint_PointOnStart_sm_xpm[] = { -"16 16 44 1", -" c None", -". c #3B0000", -"+ c #820C0C", -"@ c #830B0B", -"# c #6D0808", -"$ c #E21E1E", -"% c #C91A1A", -"& c #A71313", -"* c #760909", -"= c #D11A1A", -"- c #CD0101", -"; c #CF0404", -"> c #D90F0F", -", c #C81818", -"' c #CC1A1A", -") c #C11616", -"! c #D71212", -"~ c #CE0303", -"{ c #D51818", -"] c #6A0808", -"^ c #D51616", -"/ c #CF0303", -"( c #B81515", -"_ c #8B0D0D", -": c #D60C0C", -"< c #D71515", -"[ c #D81515", -"} c #D80D0D", -"| c #780909", -"1 c #9B1010", -"2 c #AB1414", -"3 c #710808", -"4 c #CF1717", -"5 c #D20707", -"6 c #CE0202", -"7 c #D81111", -"8 c #8F0F0F", -"9 c #9A1010", -"0 c #CC0000", -"a c #D21616", -"b c #AA1414", -"c c #D91515", -"d c #740909", -"e c #900F0F", -" ", -" . ", -" +@ ", -" #$%&* ", -" =--;>, ", -" #$')!~{ ", -" +@ ]^/( ", -" . _:< ", -" [}| ", -" 123 ", -" 45678 ", -" 95000a ", -" b~000c ", -" d700~) ", -" eac) ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm deleted file mode 100644 index c80a59ab23..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm +++ /dev/null @@ -1,55 +0,0 @@ -/* XPM */ -static char * Constraint_PointToObject_sm_xpm[] = { -"16 16 36 1", -" c None", -". c #C21616", -"+ c #D91515", -"@ c #D21616", -"# c #900F0F", -"$ c #CE0202", -"% c #CC0000", -"& c #D81111", -"* c #740909", -"= c #CE0303", -"- c #AA1414", -"; c #D30808", -"> c #9B1010", -", c #9E1111", -"' c #CF1717", -") c #480404", -"! c #C31717", -"~ c #D70D0D", -"{ c #C01717", -"] c #A91414", -"^ c #991010", -"/ c #480303", -"( c #9C1818", -"_ c #C41717", -": c #D10707", -"< c #D71313", -"[ c #7B0B0B", -"} c #9D1818", -"| c #7C0E0E", -"1 c #C01616", -"2 c #C11616", -"3 c #C51717", -"4 c #9F1111", -"5 c #D81414", -"6 c #7A0A0A", -"7 c #790A0A", -" ", -" .+@# ", -" .$%%&* ", -" +%%%=- ", -" @%%%;> , ", -" #&=;') !~{ ", -" *]^/( _:<[ ", -" } _:<[ ", -" |1:<[ ", -" 2:<[ ", -" 3:<[ ", -" 3:<[ ", -" 3:+[ ", -" 4~56 ", -" {7 ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm deleted file mode 100644 index 6f8057d248..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm +++ /dev/null @@ -1,62 +0,0 @@ -/* XPM */ -static char * Constraint_Radius_sm_xpm[] = { -"16 16 43 1", -" c None", -". c #B41414", -"+ c #CF1515", -"@ c #DB1515", -"# c #CE1515", -"$ c #B31313", -"% c #920E0E", -"& c #D71414", -"* c #8D0303", -"= c #540000", -"- c #550000", -"; c #8E0303", -"> c #900D0D", -", c #CC0E0E", -"' c #4D0000", -") c #8C0A0A", -"! c #E01919", -"~ c #8E0D0D", -"{ c #7D0B0B", -"] c #D41212", -"^ c #6D0000", -"/ c #D71515", -"( c #B41313", -"_ c #7E0B0B", -": c #580000", -"< c #8F0303", -"[ c #B21313", -"} c #D91414", -"| c #770909", -"1 c #D51313", -"2 c #570000", -"3 c #DA1515", -"4 c #510101", -"5 c #520000", -"6 c #D91515", -"7 c #D01515", -"8 c #560000", -"9 c #D61414", -"0 c #4F0000", -"a c #500000", -"b c #CD0F0F", -"c c #4E0000", -"d c #910E0E", -" ", -" .+@@#$ ", -" %&*= -;&> ", -" %,' )!~ ", -" &' {]^/ ", -" (* _]: <[ ", -" += _]: -+ ", -" } |12 3 ", -" 3 45 6 ", -" 7- 8+ ", -" $; ;[ ", -" 90 a/ ", -" %bc 0bd ", -" %/<2 - c #CE0505", -", c #CC1717", -"' c #5A0000", -") c #A20303", -"! c #A31212", -"~ c #B20D0D", -"{ c #C61313", -"] c #540000", -"^ c #5D0000", -"/ c #5C0000", -"( c #700404", -"_ c #730101", -": c #5A0101", -"< c #510000", -"[ c #900E0E", -"} c #D40909", -"| c #590000", -"1 c #DB1313", -"2 c #7D0000", -"3 c #CC1515", -"4 c #A90000", -"5 c #B41414", -"6 c #CB0101", -"7 c #860D0D", -"8 c #D50A0A", -"9 c #640000", -"0 c #C80D0D", -"a c #670000", -" ", -" .+ ", -" @#$ ", -" %&* ", -" %=- ", -" ;>, ", -" ')! ", -" ~{{{{{{{{{{{{~ ", -" ]^^^^/(_:^^^^< ", -" [}| ", -" 12 ", -" 34 ", -" 56 ", -" 789 ", -" 0a ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm deleted file mode 100644 index ea168a9e7c..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm +++ /dev/null @@ -1,71 +0,0 @@ -/* XPM */ -static char * Constraint_Symmetric_sm_xpm[] = { -"16 16 52 1", -" c None", -". c #951212", -"+ c #7C0A0A", -"@ c #790B0B", -"# c #941212", -"$ c #CB1E1E", -"% c #E62121", -"& c #B51818", -"* c #B21818", -"= c #CA1D1D", -"- c #CD0000", -"; c #E01717", -"> c #DE2222", -", c #D92121", -"' c #E11919", -") c #6C0808", -"! c #D01818", -"~ c #D10606", -"{ c #D50A0A", -"] c #E62323", -"^ c #870F0F", -"/ c #AD1414", -"( c #D61010", -"_ c #CE0101", -": c #D71010", -"< c #B01414", -"[ c #5A0606", -"} c #D61B1B", -"| c #CF0404", -"1 c #D51B1B", -"2 c #580606", -"3 c #920F0F", -"4 c #D51515", -"5 c #CD0202", -"6 c #DE1414", -"7 c #BD1A1A", -"8 c #BC1A1A", -"9 c #AC1515", -"0 c #D60C0C", -"a c #CE0303", -"b c #E52020", -"c c #BE1B1B", -"d c #D60B0B", -"e c #E52323", -"f c #890F0F", -"g c #820D0D", -"h c #E42323", -"i c #D80D0D", -"j c #D62020", -"k c #D42020", -"l c #C91D1D", -"m c #410202", -" ", -" ", -" ", -" .+ @# ", -" $%& *%$ ", -" =-;> ,'-= ", -" )!~{]^ ^]{~!) ", -" /(_$ $_:< ", -" [}|= =|12 ", -" 34567 86543 ", -" 90abc cba09 ", -" =def ghi= ", -" =j kl ", -" m m ", -" ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm deleted file mode 100644 index 5f3a119a9b..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm +++ /dev/null @@ -1,65 +0,0 @@ -/* XPM */ -static char * Constraint_TangentToEnd_sm_xpm[] = { -"16 16 46 1", -" c None", -". c #720909", -"+ c #880E0E", -"@ c #B01414", -"# c #D71111", -"$ c #B41616", -"% c #740A0A", -"& c #D31717", -"* c #D10606", -"= c #CC0000", -"- c #DE1616", -"; c #E72020", -"> c #700909", -", c #D21717", -"' c #DD1313", -") c #E51E1E", -"! c #A51717", -"~ c #920C0C", -"{ c #B21515", -"] c #B11515", -"^ c #420000", -"/ c #5F0B0B", -"( c #991616", -"_ c #A01313", -": c #880C0C", -"< c #8D0E0E", -"[ c #C01919", -"} c #4E0808", -"| c #620A0A", -"1 c #D61717", -"2 c #D91616", -"3 c #600C0C", -"4 c #4A0707", -"5 c #CE1919", -"6 c #D81616", -"7 c #4D0808", -"8 c #D61616", -"9 c #BF1919", -"0 c #7E1212", -"a c #DC1313", -"b c #660D0D", -"c c #A31717", -"d c #B41717", -"e c #CF1717", -"f c #971616", -"g c #DA1515", -" ", -" .+ ", -" @#$ ", -" %&*=---------; ", -" >,*=''''''''') ", -" !~{#]^ ", -" /(_:<[} ", -" |123 ", -" 4567 ", -" 489 ", -" 0ab ", -" 2c ", -" de ", -" fg ", -" /! ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm deleted file mode 100644 index 5193a1bc8b..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm +++ /dev/null @@ -1,72 +0,0 @@ -/* XPM */ -static char * Constraint_TangentToStart_sm_xpm[] = { -"16 16 53 1", -" c None", -". c #920E0E", -"+ c #690707", -"@ c #DB1616", -"# c #BC1616", -"$ c #CC1717", -"% c #CD0101", -"& c #D70E0E", -"* c #880D0D", -"= c #A31212", -"- c #D40909", -"; c #CC0000", -"> c #D51717", -", c #A61717", -"' c #CE1717", -") c #A41717", -"! c #660D0D", -"~ c #AE1515", -"{ c #D01C1C", -"] c #D50A0A", -"^ c #DC1A1A", -"/ c #B91818", -"( c #690A0A", -"_ c #5F0B0B", -": c #991616", -"< c #B21616", -"[ c #D91616", -"} c #DC1212", -"| c #C01919", -"1 c #4E0808", -"2 c #8B0C0C", -"3 c #C91515", -"4 c #7D1111", -"5 c #D61717", -"6 c #600C0C", -"7 c #4A0707", -"8 c #CE1919", -"9 c #D81616", -"0 c #4D0808", -"a c #D61616", -"b c #BF1919", -"c c #840B0B", -"d c #7E1212", -"e c #DC1313", -"f c #850B0B", -"g c #8F0E0E", -"h c #B41717", -"i c #970E0E", -"j c #971616", -"k c #9A0E0E", -"l c #900E0E", -"m c #E11919", -"n c #D21919", -" ", -" . ", -" +@# ", -" $%&* ", -" =-;;> ", -" ,@')! ~{]^/( ", -" _:<[}|1 2]3 ", -" 45[6 2]3 ", -" 78902]3 ", -" 7abc]3 ", -" def]3 ", -" [g]3 ", -" hi]3 ", -" jk]3 ", -" _lmn ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm deleted file mode 100644 index 88aef3fc92..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm +++ /dev/null @@ -1,64 +0,0 @@ -/* XPM */ -static char * Constraint_Tangent_sm_xpm[] = { -"16 16 45 1", -" c None", -". c #C11818", -"+ c #7C0B0B", -"@ c #9E1111", -"# c #D70D0D", -"$ c #D81414", -"% c #7B0B0B", -"& c #C31717", -"* c #D20707", -"= c #D71313", -"- c #A61717", -"; c #DB1616", -"> c #CE1717", -", c #A41717", -"' c #660D0D", -") c #7D0B0B", -"! c #5F0B0B", -"~ c #991616", -"{ c #B21616", -"] c #D91616", -"^ c #DC1212", -"/ c #C01919", -"( c #4C0404", -"_ c #7D1111", -": c #D61717", -"< c #560707", -"[ c #4A0707", -"} c #CE1919", -"| c #D81616", -"1 c #4B0404", -"2 c #C11717", -"3 c #D61616", -"4 c #BF1919", -"5 c #BE1616", -"6 c #7E1212", -"7 c #DC1313", -"8 c #C21717", -"9 c #C01717", -"0 c #A31717", -"a c #9B1111", -"b c #B41717", -"c c #CF1717", -"d c #971616", -"e c #DA1515", -"f c #A51717", -" ", -" .+ ", -" @#$% ", -" &*=+ ", -" &*=+ ", -" -;>,' &*=) ", -" !~{]^/(&*=) ", -" _:]<&*=) ", -" [}|12*=) ", -" [34 5*=) ", -" 67' 8#9 ", -" ]0 a ", -" bc ", -" de ", -" !f ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm deleted file mode 100644 index 581f2bed3f..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm +++ /dev/null @@ -1,29 +0,0 @@ -/* XPM */ -static char * Constraint_VerticalDistance_sm_xpm[] = { -"16 16 10 1", -" c None", -". c #E61F1F", -"+ c #DE1515", -"@ c #B31616", -"# c #B61717", -"$ c #B71616", -"% c #DE1F1F", -"& c #750B0B", -"* c #B01616", -"= c #710B0B", -" ", -" .++++++@ ", -" ##$+%##& ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" +@ ", -" **@+%**= ", -" .++++++@ ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm deleted file mode 100644 index 3e801d76af..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * Constraint_Vertical_sm_xpm[] = { -"16 16 5 1", -" c None", -". c #E61F1F", -"+ c #E72020", -"@ c #DD1515", -"# c #DE1515", -" ", -" .+ ", -" @@ ", -" @@ ", -" @@ ", -" @@ ", -" @@ ", -" @@ ", -" @@ ", -" @@ ", -" #@ ", -" #@ ", -" #@ ", -" #@ ", -" +. ", -" "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/README.md b/src/Mod/Sketcher/Gui/Resources/icons/small/README.md deleted file mode 100644 index 11b295e1c6..0000000000 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/README.md +++ /dev/null @@ -1,47 +0,0 @@ -To create an XPM file from an SVG file, you need the ImageMagick libraries. -Then run -``` -convert file.svg -geometry 16x16 -colors 8 file_sm.xpm -``` - -The XPM icon is very small, 16x16 px in size, and we usually don't need -more than 8 colors. - -Edit the xpm file manually to do small retouches, for example, setting up -the transparency and reducing the number of colors exactly to the desired ones. - -An XPM image has a header that defines the number of columns, number of rows, -number of colors, and number of characters per pixel. -The first rows have the colors definition, so they must match the number -of colors, while the rest corresponds to the actual bitmap image. - -The space character (empty) can be set to the color `None`, -to indicate transparency. - -``` -/* XPM */ -static char *file_sm_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1 ", -" c None", -". c #D71414", -"+ c #AA1919", -/* pixels */ -" ", -" + + ", -" +.+ +.+ ", -" +.+ +.+ ", -" + + ", -" ++++ ", -" +....+ ", -" +...++ ", -" +..+++ ", -" +.++.+ ", -" ++++ ", -" + + ", -" +.+ +.+ ", -" +.+ +.+ ", -" + + ", -" " -}; -``` diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 46538bf7b2..18b128da4a 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -70,6 +70,7 @@ # include # include # include +# include # include # include @@ -372,6 +373,7 @@ ViewProviderSketch::ViewProviderSketch() //rubberband selection rubberband = new Gui::Rubberband(); + InitItemsSizes(); } ViewProviderSketch::~ViewProviderSketch() @@ -3189,7 +3191,11 @@ QString ViewProviderSketch::getPresentationString(const Constraint *constraint) } } } - + if (constraint->Type == Sketcher::Diameter){ + userStr.insert(0, QChar(8960)); // Diameter sign + }else if (constraint->Type == Sketcher::Radius){ + userStr.insert(0, QChar(82)); // Capital letter R + } return userStr; } @@ -3198,25 +3204,25 @@ QString ViewProviderSketch::iconTypeFromConstraint(Constraint *constraint) /*! TODO: Consider pushing this functionality up into Constraint */ switch(constraint->Type) { case Horizontal: - return QString::fromLatin1("small/Constraint_Horizontal_sm"); + return QString::fromLatin1("Constraint_Horizontal"); case Vertical: - return QString::fromLatin1("small/Constraint_Vertical_sm"); + return QString::fromLatin1("Constraint_Vertical"); case PointOnObject: - return QString::fromLatin1("small/Constraint_PointOnObject_sm"); + return QString::fromLatin1("Constraint_PointOnObject"); case Tangent: - return QString::fromLatin1("small/Constraint_Tangent_sm"); + return QString::fromLatin1("Constraint_Tangent"); case Parallel: - return QString::fromLatin1("small/Constraint_Parallel_sm"); + return QString::fromLatin1("Constraint_Parallel"); case Perpendicular: - return QString::fromLatin1("small/Constraint_Perpendicular_sm"); + return QString::fromLatin1("Constraint_Perpendicular"); case Equal: - return QString::fromLatin1("small/Constraint_EqualLength_sm"); + return QString::fromLatin1("Constraint_EqualLength"); case Symmetric: - return QString::fromLatin1("small/Constraint_Symmetric_sm"); + return QString::fromLatin1("Constraint_Symmetric"); case SnellsLaw: - return QString::fromLatin1("small/Constraint_SnellsLaw_sm"); + return QString::fromLatin1("Constraint_SnellsLaw"); case Block: - return QString::fromLatin1("small/Constraint_Block_sm"); + return QString::fromLatin1("Constraint_Block"); default: return QString(); } @@ -3451,7 +3457,7 @@ void ViewProviderSketch::combineConstraintIcons(IconQueue iconQueue) iconQueue.pop_back(); // we group only icons not being Symmetry icons, because we want those on the line - if(init.type != QString::fromLatin1("small/Constraint_Symmetric_sm")){ + if(init.type != QString::fromLatin1("Constraint_Symmetric")){ IconQueue::iterator i = iconQueue.begin(); while(i != iconQueue.end()) { @@ -3460,7 +3466,7 @@ void ViewProviderSketch::combineConstraintIcons(IconQueue iconQueue) for(IconQueue::iterator j = thisGroup.begin(); j != thisGroup.end(); ++j) { float distSquared = pow(i->position[0]-j->position[0],2) + pow(i->position[1]-j->position[1],2); - if(distSquared <= maxDistSquared && (*i).type != QString::fromLatin1("small/Constraint_Symmetric_sm")) { + if(distSquared <= maxDistSquared && (*i).type != QString::fromLatin1("Constraint_Symmetric")) { // Found an icon in iconQueue that's close enough to // a member of thisGroup, so move it into thisGroup thisGroup.push_back(*i); @@ -3646,10 +3652,10 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type, // Constants to help create constraint icons QString joinStr = QString::fromLatin1(", "); - QImage icon = Gui::BitmapFactory().pixmap(type.toLatin1()).toImage(); + QImage icon = Gui::BitmapFactory().pixmapFromSvg(type.toLatin1().data(),QSizeF(constraintIconSize,constraintIconSize)).toImage(); QFont font = QApplication::font(); - font.setPixelSize(11); + font.setPixelSize(constraintIconSize * 0.8); font.setBold(true); QFontMetrics qfm = QFontMetrics(font); @@ -3748,6 +3754,20 @@ float ViewProviderSketch::getScaleFactor() } } +void ViewProviderSketch::InitItemsSizes() +{ + int defaultFontSize = QApplication::fontMetrics().height(); + int ldpi = QApplication::desktop()->logicalDpiX(); + float virtualdpi = 96.; + float QtPixelRatio = virtualdpi/ldpi; + float coinFontPixelRatio = QtPixelRatio; // this is not absolute exactly, but the ratio is correct + float view3D_factor = 1.25; // View3D area has worse readability, so let's increase a little + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); + coinFontSize = hGrp->GetInt("EditSketcherFontSize", defaultFontSize * QtPixelRatio * coinFontPixelRatio *view3D_factor ); + constraintIconSize = coinFontSize / coinFontPixelRatio; + return; +} + void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer /*=true*/) { assert(edit); @@ -3783,9 +3803,6 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer Gui::coinRemoveAllChildren(edit->infoGroup); } - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - int fontSize = hGrp->GetInt("EditSketcherFontSize", 17); - int currentInfoNode = 0; ParameterGrp::handle hGrpsk = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General"); @@ -3798,6 +3815,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer int GeoId = 0; + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); int stdcountsegments = hGrp->GetInt("SegmentsPerGeometry", 50); // value cannot be smaller than 3 if (stdcountsegments < 3) @@ -4228,7 +4246,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer SoFont *font = new SoFont; font->name.setValue("Helvetica"); - font->size.setValue(fontSize); + font->size.setValue(coinFontSize); SoText2 *degreetext = new SoText2; degreetext->string = SbString(spline->getDegree()); @@ -4507,7 +4525,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer SoFont *font = new SoFont; font->name.setValue("Helvetica"); - font->size.setValue(fontSize); + font->size.setValue(coinFontSize); SoText2 *degreetext = new SoText2; degreetext->string = SbString("(") + SbString(*itm) + SbString(")"); @@ -4574,7 +4592,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer SoFont* font = new SoFont; font->name.setValue("Helvetica"); - font->size.setValue(fontSize); + font->size.setValue(coinFontSize); translate->translation.setValue(poleposition.x, poleposition.y, zInfo); @@ -5748,9 +5766,6 @@ void ViewProviderSketch::rebuildConstraintsVisual(void) Gui::coinRemoveAllChildren(edit->constrGroup); edit->vConstrType.clear(); - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - int fontSize = hGrp->GetInt("EditSketcherFontSize", 17); - for (std::vector::const_iterator it=constrlist.begin(); it != constrlist.end(); ++it) { // root separator for one constraint SoSeparator *sep = new SoSeparator(); @@ -5795,7 +5810,7 @@ void ViewProviderSketch::rebuildConstraintsVisual(void) ConstrDimColor :NonDrivingConstrDimColor) :DeactivatedConstrDimColor; - text->size.setValue(fontSize); + text->size.setValue(coinFontSize); text->useAntialiasing = false; SoAnnotation *anno = new SoAnnotation(); anno->renderCaching = SoSeparator::OFF; @@ -6508,10 +6523,9 @@ void ViewProviderSketch::createEditInventorNodes(void) CoordTextMaterials->diffuseColor = cursorTextColor; Coordsep->addChild(CoordTextMaterials); - int fontSize = hGrp->GetInt("EditSketcherFontSize", 17); - SoFont *font = new SoFont(); - font->size.setValue(fontSize); + font->size.setValue(coinFontSize); + Coordsep->addChild(font); edit->textPos = new SoTranslation(); diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index b2cab12f70..2650b06ffc 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -113,6 +113,9 @@ public: App::PropertyBool RestoreCamera; App::PropertyString EditingWorkbench; + /// set icon & font sizes + void InitItemsSizes(); + /// Draw all constraint icons /*! Except maybe the radius and lock ones? */ void drawConstraintIcons(); @@ -468,6 +471,9 @@ protected: bool isShownVirtualSpace; // indicates whether the present virtual space view is the Real Space or the Virtual Space (virtual space 1 or 2) ShortcutListener* listener; + + int coinFontSize; + int constraintIconSize; }; } // namespace PartGui