Skip to content

Commit cd0a550

Browse files
committed
More theming
1 parent 91c649b commit cd0a550

13 files changed

Lines changed: 494 additions & 294 deletions

File tree

Packages/com.walletconnect.web3modal/Resources/WalletConnect/Web3Modal/Components/ModalHeader/ModalHeader.uss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
width: 100%;
33
height: 63;
44
border-bottom-width: 1;
5-
border-color: rgba(255, 255, 255, 0.05);
5+
border-color: var(--wui-modal-header-border-color);
66
}
77

88
#modal-header__container {
@@ -12,7 +12,7 @@
1212
}
1313

1414
#modal-header__body {
15-
color: rgba(228, 231, 231, 1);
15+
color: var(--wui-color-fg-100);
1616
padding-left: 12;
1717
padding-right: 12;
1818
}

Packages/com.walletconnect.web3modal/Resources/WalletConnect/Web3Modal/Components/QrCode/QrCode.uss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.qrcode {
22
width: 100%;
33
height: 100%;
4-
border-radius: 36px;
4+
border-radius: var(--wui-border-radius-l);
55
overflow: hidden;
66
}
77

Packages/com.walletconnect.web3modal/Runtime/Components/QrCode.cs

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,34 @@ namespace WalletConnect.UI
77
{
88
public class QrCode : VisualElement
99
{
10-
public static readonly string ussClassName = "qrcode";
10+
public const string Name = "qrcode";
11+
12+
private static readonly CustomStyleProperty<Color> BgColorProperty = new("--wui-qrcode-bg-color");
13+
private static readonly CustomStyleProperty<Color> FgColorProperty = new("--wui-qrcode-fg-color");
14+
15+
private readonly Image _qrcodeImage;
16+
17+
private Color _bgColor = Color.white;
18+
private Color _fgColor = Color.black;
19+
private string _data;
20+
21+
public QrCode() : this(string.Empty)
22+
{
23+
}
24+
25+
public QrCode(string data)
26+
{
27+
var asset = Resources.Load<VisualTreeAsset>("WalletConnect/Web3Modal/Components/QrCode/QrCode");
28+
asset.CloneTree(this);
29+
30+
AddToClassList(Name);
31+
32+
_qrcodeImage = this.Q<Image>("qrcode-image");
33+
34+
Data = data;
35+
36+
RegisterCallback(new EventCallback<CustomStyleResolvedEvent>(CustomStyleResolvedHandler));
37+
}
1138

1239
public string Data
1340
{
@@ -28,33 +55,20 @@ public string Data
2855
else
2956
{
3057
WCLoadingAnimator.Instance.Unsubscribe(_qrcodeImage);
31-
_qrcodeImage.image = QRCode.EncodeTexture(value);
58+
_qrcodeImage.image = QRCode.EncodeTexture(value, _fgColor, _bgColor);
3259
_data = value;
3360
}
3461
}
3562
}
3663

37-
private readonly Image _qrcodeImage;
38-
private string _data;
39-
40-
public new class UxmlFactory : UxmlFactory<QrCode>
41-
{
42-
}
43-
44-
public QrCode() : this(string.Empty)
64+
private void CustomStyleResolvedHandler(CustomStyleResolvedEvent evt)
4565
{
66+
_ = evt.customStyle.TryGetValue(BgColorProperty, out _bgColor);
67+
_ = evt.customStyle.TryGetValue(FgColorProperty, out _fgColor);
4668
}
4769

48-
public QrCode(string data)
70+
public new class UxmlFactory : UxmlFactory<QrCode>
4971
{
50-
var asset = Resources.Load<VisualTreeAsset>("WalletConnect/Web3Modal/Components/QrCode/QrCode");
51-
asset.CloneTree(this);
52-
53-
AddToClassList(ussClassName);
54-
55-
_qrcodeImage = this.Q<Image>("qrcode-image");
56-
57-
Data = data;
5872
}
5973
}
6074
}

Packages/com.walletconnect.web3modal/Runtime/Views/WalletSearchView/WalletSearchView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public WalletSearchView()
5858
// --- ScrollView
5959
scrollView = this.Q<ScrollView>();
6060
scrollView.mode = ScrollViewMode.Vertical;
61-
scrollView.mouseWheelScrollSize = 50;
61+
scrollView.mouseWheelScrollSize = 60;
6262
scrollView.horizontalScrollerVisibility = ScrollerVisibility.Hidden;
6363
scrollView.verticalScrollerVisibility = ScrollerVisibility.Hidden;
6464

Packages/com.walletconnect.web3modal/UI Toolkit/WUI Base Theme.tss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@
8585
--wui-modal-border-color: var(--wui-gray-glass-005);
8686
--wui-modal-border-width: 1px;
8787

88+
--wui-modal-header-border-color: var(--wui-gray-glass-005);
8889

8990
--wui-card-select-bg-color: var(--wui-gray-glass-002);
9091
--wui-card-select-bg-color-hover: var(--wui-gray-glass-005);
9192
--wui-card-select-border-color: rgba(0, 0, 0, 0);
9293
--wui-card-select-border-width: 1px;
9394
--wui-card-select-image-border-color: var(--wui-gray-glass-010);
9495
--wui-card-select-image-border-width: 1px;
96+
97+
--wui-qrcode-bg-color: white;
98+
--wui-qrcode-fg-color: black;
9599
}
96100

97101
.text-micro {

Samples/Customization/.idea/.idea.Customization/.idea/vcs.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/Customization/Assets/Resources/TF2 Font/TF2 Build SDF Heavy.asset

Lines changed: 28 additions & 5 deletions
Large diffs are not rendered by default.

Samples/Customization/Assets/Resources/TF2 Font/TF2 Build SDF Regular.asset

Lines changed: 113 additions & 32 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)