Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit a2eab8c

Browse files
committed
UI adjustment; core update; duplicate rule sets
1 parent 88f5a2d commit a2eab8c

6 files changed

+27
-13
lines changed

V2RayX/AdvancedWindow.xib

+11-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
5050
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
5151
<rect key="frame" x="0.0" y="0.0" width="540" height="455"/>
52-
<autoresizingMask key="autoresizingMask"/>
52+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
5353
<subviews>
5454
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Vwe-wN-xLw">
5555
<rect key="frame" x="450" y="9" width="76" height="32"/>
@@ -189,7 +189,7 @@ Gw
189189
</view>
190190
</tabViewItem>
191191
<tabViewItem label="Subscription" identifier="" id="c9O-2e-b8g">
192-
<view key="view" ambiguous="YES" id="WC0-rc-GkH">
192+
<view key="view" id="WC0-rc-GkH">
193193
<rect key="frame" x="10" y="33" width="494" height="360"/>
194194
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
195195
<subviews>
@@ -265,7 +265,7 @@ Gw
265265
</view>
266266
</tabViewItem>
267267
<tabViewItem label="Rules" identifier="" id="i0P-1v-Yeh">
268-
<view key="view" id="uJw-Fs-Pqs">
268+
<view key="view" ambiguous="YES" id="uJw-Fs-Pqs">
269269
<rect key="frame" x="10" y="33" width="494" height="360"/>
270270
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
271271
<subviews>
@@ -274,7 +274,7 @@ Gw
274274
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
275275
<clipView key="contentView" ambiguous="YES" id="R4k-Ta-qWH">
276276
<rect key="frame" x="1" y="1" width="112" height="321"/>
277-
<autoresizingMask key="autoresizingMask"/>
277+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
278278
<subviews>
279279
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" id="wbH-CA-T9F">
280280
<rect key="frame" x="0.0" y="0.0" width="112" height="321"/>
@@ -411,7 +411,7 @@ Gw
411411
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
412412
<clipView key="contentView" ambiguous="YES" id="svV-1v-pv5">
413413
<rect key="frame" x="1" y="1" width="85" height="228"/>
414-
<autoresizingMask key="autoresizingMask"/>
414+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
415415
<subviews>
416416
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" id="VlQ-mV-pLn">
417417
<rect key="frame" x="0.0" y="0.0" width="85" height="228"/>
@@ -493,7 +493,7 @@ Gw
493493
<autoresizingMask key="autoresizingMask"/>
494494
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="RDn-zh-dIS">
495495
<rect key="frame" x="0.0" y="0.0" width="217" height="137"/>
496-
<autoresizingMask key="autoresizingMask"/>
496+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
497497
<subviews>
498498
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="1mD-il-bEM">
499499
<rect key="frame" x="0.0" y="0.0" width="217" height="137"/>
@@ -565,16 +565,16 @@ Gw
565565
<segmentedCell key="cell" borderStyle="border" alignment="left" style="smallSquare" trackingMode="momentary" id="N82-tM-ejL">
566566
<font key="font" metaFont="system"/>
567567
<segments>
568-
<segment image="NSAddTemplate">
568+
<segment image="NSAddTemplate" width="27">
569569
<nil key="label"/>
570570
</segment>
571-
<segment image="NSRemoveTemplate" tag="1">
571+
<segment image="NSRemoveTemplate" width="27" tag="1">
572572
<nil key="label"/>
573573
</segment>
574-
<segment image="NSRefreshTemplate">
574+
<segment image="NSRefreshTemplate" width="27">
575575
<nil key="label"/>
576576
</segment>
577-
<segment width="28">
577+
<segment image="config_duplicate" width="28">
578578
<nil key="label"/>
579579
</segment>
580580
</segments>
@@ -865,5 +865,6 @@ will match all private IPs.</string>
865865
<image name="NSAddTemplate" width="11" height="11"/>
866866
<image name="NSRefreshTemplate" width="11" height="15"/>
867867
<image name="NSRemoveTemplate" width="11" height="11"/>
868+
<image name="config_duplicate" width="12" height="12"/>
868869
</resources>
869870
</document>

V2RayX/AdvancedWindowController.m

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ - (void)windowDidLoad {
3535
[super windowDidLoad];
3636

3737
// initialize UI
38+
[_outboundTable setFocusRingType:NSFocusRingTypeNone];
39+
[_ruleTable setFocusRingType:NSFocusRingTypeNone];
40+
[_ruleSetTable setFocusRingType:NSFocusRingTypeNone];
41+
[_configTable setFocusRingType:NSFocusRingTypeNone];
42+
[_subscriptionTable setFocusRingType:NSFocusRingTypeNone];
3843
[[self domainStrategyButton] removeAllItems];
3944
for(NSString* strategy in DOMAIN_STRATEGY_LIST) {
4045
[[self domainStrategyButton] addItemWithTitle:strategy];
@@ -301,6 +306,7 @@ -(void)textDidEndEditing:(NSNotification *)notification {
301306
}
302307

303308
- (IBAction)addRemoveRuleSet:(id)sender {
309+
[[self window] makeFirstResponder:_ruleSetTable];
304310
if ([sender selectedSegment] == 0) {
305311
NSMutableDictionary* newRuleSet = [ROUTING_DIRECT mutableDeepCopy];
306312
newRuleSet[@"name"] = @"new_rule_set";
@@ -328,6 +334,10 @@ - (IBAction)addRemoveRuleSet:(id)sender {
328334
[self->_ruleSetTable reloadData];
329335
}
330336
}];
337+
} else if ([sender selectedSegment] == 3 && _selectedRuleSet >= 0 && _selectedRuleSet < _routingRuleSets.count) {
338+
[_routingRuleSets addObject:[[_routingRuleSets objectAtIndex:_selectedRuleSet] mutableDeepCopy]];
339+
[_ruleSetTable reloadData];
340+
[_ruleSetTable selectRowIndexes:[NSIndexSet indexSetWithIndex:_routingRuleSets.count - 1] byExtendingSelection:NO]; // toggle
331341
}
332342
}
333343

@@ -338,6 +348,7 @@ - (IBAction)didSelectStrategy:(id)sender {
338348
}
339349

340350
- (IBAction)addRemoveRule:(id)sender {
351+
[[self window] makeFirstResponder:_ruleTable];
341352
NSMutableArray* rules = _routingRuleSets[_selectedRuleSet][@"rules"];
342353
if ([sender selectedSegment] == 0) {
343354
[rules insertObject:[@{

V2RayX/ConfigWindow.xib

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
164164
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
165165
</tableHeaderCell>
166-
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" title="Text Cell" id="OSC-ac-Duc">
166+
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" title="Text Cell" usesSingleLineMode="YES" id="OSC-ac-Duc">
167167
<font key="font" metaFont="system"/>
168168
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
169169
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>

V2RayX/ConfigWindowController.m

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ - (void)windowDidLoad {
5757
}
5858

5959
//set textField Display
60+
[_profileTable setFocusRingType:NSFocusRingTypeNone];
6061
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
6162
[formatter setNumberStyle:NSNumberFormatterNoStyle];
6263
[_portField setFormatter:formatter];
@@ -159,6 +160,7 @@ - (BOOL)checkTLSforHttp2 {
159160
}
160161

161162
- (IBAction)addRemoveServer:(id)sender {
163+
[[self window] makeFirstResponder:_profileTable];
162164
if ([sender selectedSegment] == 0) {
163165
ServerProfile* newProfile = [[ServerProfile alloc] init];
164166
[_profiles addObject:newProfile];

V2RayX/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>1251</string>
24+
<string>1274</string>
2525
<key>LSMinimumSystemVersion</key>
2626
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2727
<key>LSUIElement</key>

V2RayX/dlcore.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION="4.10.0"
1+
VERSION="4.12.0"
22
RED='\033[0;31m'
33
GREEN='\033[0;32m'
44
BOLD='\033[1m'

0 commit comments

Comments
 (0)