mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Don't expand widgets on hover (#7808)
* Part of https://github.com/emilk/egui/issues/5605 This changes the default style of egui. The problem with "expanding" widgets is that they now want to paint outside their own bounds, which then requires all parent UIs to have proper margins. It also means hovered things are no longer properly aligned with every other widget.
This commit is contained in:
@@ -1234,6 +1234,11 @@ pub struct WidgetVisuals {
|
||||
pub fg_stroke: Stroke,
|
||||
|
||||
/// Make the frame this much larger.
|
||||
///
|
||||
/// The problem with "expanding" widgets is that they now want to paint outside their own bounds,
|
||||
/// which then requires all parent UIs to have proper margins.
|
||||
///
|
||||
/// It also means hovered things are no longer properly aligned with every other widget.
|
||||
pub expansion: f32,
|
||||
}
|
||||
|
||||
@@ -1568,7 +1573,7 @@ impl Widgets {
|
||||
bg_stroke: Stroke::new(1.0, Color32::from_gray(150)), // e.g. hover over window edge or button
|
||||
fg_stroke: Stroke::new(1.5, Color32::from_gray(240)),
|
||||
corner_radius: CornerRadius::same(3),
|
||||
expansion: 1.0,
|
||||
expansion: 0.0,
|
||||
},
|
||||
active: WidgetVisuals {
|
||||
weak_bg_fill: Color32::from_gray(55),
|
||||
@@ -1576,7 +1581,7 @@ impl Widgets {
|
||||
bg_stroke: Stroke::new(1.0, Color32::WHITE),
|
||||
fg_stroke: Stroke::new(2.0, Color32::WHITE),
|
||||
corner_radius: CornerRadius::same(2),
|
||||
expansion: 1.0,
|
||||
expansion: 0.0,
|
||||
},
|
||||
open: WidgetVisuals {
|
||||
weak_bg_fill: Color32::from_gray(45),
|
||||
@@ -1613,7 +1618,7 @@ impl Widgets {
|
||||
bg_stroke: Stroke::new(1.0, Color32::from_gray(105)), // e.g. hover over window edge or button
|
||||
fg_stroke: Stroke::new(1.5, Color32::BLACK),
|
||||
corner_radius: CornerRadius::same(3),
|
||||
expansion: 1.0,
|
||||
expansion: 0.0,
|
||||
},
|
||||
active: WidgetVisuals {
|
||||
weak_bg_fill: Color32::from_gray(165),
|
||||
@@ -1621,7 +1626,7 @@ impl Widgets {
|
||||
bg_stroke: Stroke::new(1.0, Color32::BLACK),
|
||||
fg_stroke: Stroke::new(2.0, Color32::BLACK),
|
||||
corner_radius: CornerRadius::same(2),
|
||||
expansion: 1.0,
|
||||
expansion: 0.0,
|
||||
},
|
||||
open: WidgetVisuals {
|
||||
weak_bg_fill: Color32::from_gray(220),
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7051c34854469652d2d953f3110ebcf6fd60f8ee9a2b0c134d9f7255ef180ce5
|
||||
size 335353
|
||||
oid sha256:5878bc5beaf4406c24f23d900aa9ac7c5507e44cb3ade83b743b8b62e7da1615
|
||||
size 335355
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:49823cfa4dfba54e54d0122f2bbb246c1daad2ca3ba15071c1ca44eeb3662855
|
||||
size 92791
|
||||
oid sha256:706ad012e52a8c51175b050b985cca88e2cb306b24f618b7391641397d17cd28
|
||||
size 92804
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1b65b6b1a3afe41337b8fe537525677284e49bd90be29cddb837787162ee452a
|
||||
size 169596
|
||||
oid sha256:4135662f2b60a10ef8c3b155172d7a3edcf24a625d8286aeaad0614aa8819893
|
||||
size 169604
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9c3af0c37a6997abe549dd28450c41d3d18bbc99d9577997d493566fbb7f9277
|
||||
size 96709
|
||||
oid sha256:509020d8885b718900e534c9948cb95ae88e1eee9e113bdfb77a2f75b9a68f7b
|
||||
size 96703
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:27e4950f17ab7f68f7e001ca3a4f3fc18943103f4745c87715dcf6c097e92a57
|
||||
size 11131
|
||||
oid sha256:5b6447dd4bd6489b9b909b8240abe54db16331beaa2fb4656f01f79a08fb25f9
|
||||
size 11112
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:449cc473469dc80af81fe20e394dd90e67b4ae9c2033ebb7029726274d77d50c
|
||||
size 21644
|
||||
oid sha256:4baf110e63fb104f30e9ae06e3601cfb48d7b69aec31636ca470c9ba9f6d44a9
|
||||
size 21659
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1cbfc767ed169cbddb3c90c2b455daefd85925501e7e33c7a25a34a72fc13eac
|
||||
size 28512
|
||||
oid sha256:93d2f336e216f371e7239b08113e659bad6c30eb299a2d8ea9537ae1c63533f0
|
||||
size 28503
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f4397b3d86bb5fe76d661cdb109ef71d43e771093bd9267b74722660d312ec7d
|
||||
size 33253
|
||||
oid sha256:6bf27cde6a87112a1ae832a65c80a9e34243b6ee368314379f5bf018edf439e5
|
||||
size 33239
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fad8b83e553ffa6bfbc4d47b955f2180859048c3789dda99b640e27665d216c7
|
||||
size 2244
|
||||
oid sha256:e86ed66f3ac3a81998eefbed8cb231edc6522174050676b45e9248f9e7f18533
|
||||
size 2227
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1d1102bc84e5ea0b021c6674ca243e51f011cd9212991a245addf0459e045293
|
||||
size 2347
|
||||
oid sha256:ddd940c1ed581471b1448c04296d48b829939025980479a122edfe9b9bd0321e
|
||||
size 2321
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:28b76c813a9eb7d4b49ffdc25fa63e208396489bd5547602b9df1eeb125b3b4a
|
||||
size 2305
|
||||
oid sha256:a53c074ad4cb1f0e38d6d7144cb661a2b68d809203bfca636ff5a60d8582a651
|
||||
size 2288
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4fdb8db17e3ec526c698812b9912555d1fa3837ba601fd9b39b6c7e9d451a070
|
||||
size 3007
|
||||
oid sha256:0a9be0d364374237ea9c3cbfc3703f47f4345d81cecbdcf6c4b49688c4c282ad
|
||||
size 2982
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:863c60a3246d123b958f0ef8245999da23a9e4fadc942282a4231212b26246dd
|
||||
size 10879
|
||||
oid sha256:ec81a46d44402d5e709d825e42de99a2f7b9707f77dc5f94e277ae9fd77b6fae
|
||||
size 10903
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a67a3272a3816120f0dc8857086f7c96352366823f6cebc85059abeced8c0cc2
|
||||
size 11972
|
||||
oid sha256:a6a3eb59ff208d106c3808265d4bef10d80b634f74d99476c3541d997b30bc56
|
||||
size 11967
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1aa2bfe30e56a7f86145007989fafbc13271cc8268c876c51826d92683125b1a
|
||||
size 14763
|
||||
oid sha256:176df42437cc8f6f97bba4b0f9bea72c9359f69e66abfa289d0701814f8ad258
|
||||
size 14746
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3379de9b9c49f6d930203b1bfb1b64951ec78bd712d12dd31ca8a01f5e6b69b
|
||||
size 14370
|
||||
oid sha256:5003e67baed533e485448b953b616804047b9da25d2758b288c96e65d7f37b0f
|
||||
size 14323
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9f1a6442ac27ddb872d9236f6e9041e1552d73926d20ef43a6ad9f2be911cf19
|
||||
size 13500
|
||||
oid sha256:929d06a271e98f0c0a2a72fc63648693b22885f80beda0a7baa5858ceb6f952b
|
||||
size 13507
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6a475763dd3c18e2d027016906e02e5127515bcf89085eb0621022b980278424
|
||||
size 14599
|
||||
oid sha256:880881761251b70d2c841b8aef3895e95a5eea499d2ff554d3f68b888fb167f9
|
||||
size 14571
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:540388365970accbc4c03aa34809b1f07d4e31c8d56bccb8f73da9c2292cb36a
|
||||
size 8426
|
||||
oid sha256:3d42e002c3fd34f96d58ddfd4d2f91cf1ac7755ff71b5da315be4bee6bf00e03
|
||||
size 8411
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8556c997810eeafc522710365914bca9aefec1362860086e69b2182820444b20
|
||||
size 12192
|
||||
oid sha256:d54388fca5de500aafde4efc73df5cc15a72ce5443c9f527ffb70430c08e60e9
|
||||
size 11871
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a44028c96d97b68cb2ab44d9d52ec7a8c353d8d11022967c345b2536dc4e5c7
|
||||
size 12890
|
||||
oid sha256:8aec08c983f71cf4fa81e88ba1751de1253d9ba6d28692b824912ad4764471bc
|
||||
size 12563
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7d4aa6f3a30fa438667b7d63d3b25bb0d478bc1284f87f002f6727d8dfd5a33e
|
||||
size 13923
|
||||
oid sha256:79f8fd0df269a45ee5a8cb6ddd1501a562e92de2bec15ab28016ceb2834c3c90
|
||||
size 13908
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0e5a20f72effd38e26dfe8ffd9e1d484bf1000340191eb7ef6188a082f4ee6f1
|
||||
size 13929
|
||||
oid sha256:966c55de5786c1ad0165e0cca29481d51770e23173b5dda14e40013669d3db6d
|
||||
size 13889
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cc69a14376d18201885502575595bfe61c06a6917074892d72aa9189e57d327c
|
||||
size 9965
|
||||
oid sha256:ff67666113e08d60f1d2310a3a5fca30316953cdabfcc4b259ee816eb498f209
|
||||
size 9900
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3b322265006cd8e5ef6dfddafb38c8a47714d084402bd2fbc9bc80b4ff10e8e7
|
||||
size 8214
|
||||
oid sha256:8d259d113aa23089992b04f19e71c743272dda3fc9baa9612565158f15ace57e
|
||||
size 8159
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:65cf9db0c073eae5a484058bd26f41d89da949bdca3144ec73aa21878e248923
|
||||
size 11011
|
||||
oid sha256:a1e56f1b6970c14830d8869f4d8cacfed821ec2b3aab7033b1bfd213a864da79
|
||||
size 10959
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:188be46ed22526b36620539c802bf7b4a116b574eb790d1c3ff18058fe37b807
|
||||
size 21534
|
||||
oid sha256:b1533e0ebaf0bd161e651d21ed81d36e8f0be06003357d9e5091ce2db4df5b7d
|
||||
size 21517
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:afeb3a0de414de4e5ab00ecb9eb7e3e69ed0dc85b5e419a796c3e7159d6da3de
|
||||
size 10360
|
||||
oid sha256:493649ea09351835147aa6cc800858939dd44beafe37adc488b63b291d58e3b3
|
||||
size 10302
|
||||
|
||||
Reference in New Issue
Block a user