mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Improve media sending options tooltip
This commit is contained in:
parent
c2ab9b9caf
commit
899ed547a2
@ -151,6 +151,8 @@
|
||||
[strongSelf.window endEditing:true];
|
||||
if (strongSelf->_doneLongPressed != nil)
|
||||
strongSelf->_doneLongPressed(strongSelf->_currentItem);
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@(3) forKey:@"TG_displayedMediaTimerTooltip_v3"];
|
||||
};
|
||||
|
||||
_muteButton = [[TGModernButton alloc] initWithFrame:CGRectMake(0, 0, 39.0f, 39.0f)];
|
||||
@ -920,7 +922,7 @@
|
||||
|
||||
- (bool)shouldDisplayTooltip
|
||||
{
|
||||
return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"TG_displayedMediaTimerTooltip_v2"] boolValue];
|
||||
return [[[NSUserDefaults standardUserDefaults] objectForKey:@"TG_displayedMediaTimerTooltip_v3"] intValue] < 3;
|
||||
}
|
||||
|
||||
- (void)setupTooltip:(CGRect)rect
|
||||
@ -928,7 +930,7 @@
|
||||
if (_tooltipContainerView != nil || !_hasTimer)
|
||||
return;
|
||||
|
||||
_tooltipTimer = [TGTimerTarget scheduledMainThreadTimerWithTarget:self action:@selector(tooltipTimerTick) interval:2.5 repeat:false];
|
||||
_tooltipTimer = [TGTimerTarget scheduledMainThreadTimerWithTarget:self action:@selector(tooltipTimerTick) interval:3.5 repeat:false];
|
||||
|
||||
_tooltipContainerView = [[TGMenuContainerView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.frame.size.width, self.frame.size.height)];
|
||||
[self addSubview:_tooltipContainerView];
|
||||
@ -943,7 +945,8 @@
|
||||
|
||||
[_tooltipContainerView showMenuFromRect:rect animated:false];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@true forKey:@"TG_displayedMediaTimerTooltip_v2"];
|
||||
int counter = [[[NSUserDefaults standardUserDefaults] objectForKey:@"TG_displayedMediaTimerTooltip_v3"] intValue];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@(counter + 1) forKey:@"TG_displayedMediaTimerTooltip_v3"];
|
||||
}
|
||||
|
||||
- (void)tooltipTimerTick
|
||||
|
@ -61,7 +61,7 @@ const CGFloat TGPhotoPaintSettingsPadPickerWidth = 360.0f;
|
||||
_eyedropperButton.exclusiveTouch = true;
|
||||
[_eyedropperButton setImage:TGTintedImage([UIImage imageNamed:@"Editor/Eyedropper"], [UIColor whiteColor]) forState:UIControlStateNormal];
|
||||
[_eyedropperButton addTarget:self action:@selector(eyedropperButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self addSubview:_eyedropperButton];
|
||||
// [self addSubview:_eyedropperButton];
|
||||
|
||||
_settingsButton = [[TGModernButton alloc] initWithFrame:CGRectMake(0, 0, 44.0f, 44.0f)];
|
||||
_settingsButton.exclusiveTouch = true;
|
||||
@ -211,7 +211,8 @@ const CGFloat TGPhotoPaintSettingsPadPickerWidth = 360.0f;
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
CGFloat inset = 66.0f;
|
||||
CGFloat leftInset = 23.0f;
|
||||
CGFloat rightInset = 66.0f;
|
||||
CGFloat colorPickerHeight = 10.0f;
|
||||
if (self.frame.size.width > self.frame.size.height)
|
||||
{
|
||||
@ -222,14 +223,14 @@ const CGFloat TGPhotoPaintSettingsPadPickerWidth = 360.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
_colorPicker.frame = CGRectMake(inset, ceil((self.frame.size.height - colorPickerHeight) / 2.0f), self.frame.size.width - inset - inset, colorPickerHeight);
|
||||
_colorPicker.frame = CGRectMake(leftInset, ceil((self.frame.size.height - colorPickerHeight) / 2.0f), self.frame.size.width - leftInset - rightInset, colorPickerHeight);
|
||||
_eyedropperButton.frame = CGRectMake(10.0f, floor((self.frame.size.height - _eyedropperButton.frame.size.height) / 2.0f) + 1.0f, _eyedropperButton.frame.size.width, _eyedropperButton.frame.size.height);
|
||||
_settingsButton.frame = CGRectMake(self.frame.size.width - _settingsButton.frame.size.width - 10.0f, floor((self.frame.size.height - _settingsButton.frame.size.height) / 2.0f) + 1.0f, _settingsButton.frame.size.width, _settingsButton.frame.size.height);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_colorPicker.frame = CGRectMake(ceil((self.frame.size.width - colorPickerHeight) / 2.0f), inset, colorPickerHeight, self.frame.size.height - inset - inset);
|
||||
_colorPicker.frame = CGRectMake(ceil((self.frame.size.width - colorPickerHeight) / 2.0f), rightInset, colorPickerHeight, self.frame.size.height - leftInset - rightInset);
|
||||
_eyedropperButton.frame = CGRectMake(floor((self.frame.size.width - _eyedropperButton.frame.size.width) / 2.0f), self.frame.size.height - _eyedropperButton.frame.size.height - 10.0, _eyedropperButton.frame.size.width, _eyedropperButton.frame.size.height);
|
||||
_settingsButton.frame = CGRectMake(floor((self.frame.size.width - _settingsButton.frame.size.width) / 2.0f), 10.0f, _settingsButton.frame.size.width, _settingsButton.frame.size.height);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user