mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Merge branch 'development' into feature/updating
This commit is contained in:
commit
d15244f330
18 files changed
+129
-23
No files matched your search
@@ -14,7 +14,7 @@ namespace Artemis.UI.Screens.Debugger.Logs;
|
||||
public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
|
||||
{
|
||||
private int _lineCount;
|
||||
private TextEditor _textEditor;
|
||||
private TextEditor? _textEditor;
|
||||
|
||||
public LogsDebugView()
|
||||
{
|
||||
@@ -31,7 +31,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
Dispatcher.UIThread.Post(() => _textEditor.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
|
||||
Dispatcher.UIThread.Post(() => _textEditor?.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
|
||||
}
|
||||
|
||||
private void OnTextChanged(object? sender, EventArgs e)
|
||||
@@ -49,7 +49,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
|
||||
//we need this help distance because of rounding.
|
||||
//if we scroll slightly above the end, we still want it
|
||||
//to scroll down to the new lines.
|
||||
const double graceDistance = 1d;
|
||||
const double GRACE_DISTANCE = 1d;
|
||||
|
||||
//if we were at the bottom of the log and
|
||||
//if the last log event was 5 lines long
|
||||
@@ -59,7 +59,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
|
||||
//if we are more than that out of sync,
|
||||
//the user scrolled up and we should not
|
||||
//mess with anything.
|
||||
if (_lineCount == 0 || linesAdded + graceDistance > outOfScreenLines)
|
||||
if (_lineCount == 0 || linesAdded + GRACE_DISTANCE > outOfScreenLines)
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => _textEditor.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
|
||||
_lineCount = _textEditor.LineCount;
|
||||
|
||||
@@ -23,6 +23,7 @@ public class SettingsViewModel : MainScreenViewModel
|
||||
releasesTabViewModel,
|
||||
aboutTabViewModel
|
||||
};
|
||||
_selectedTab = generalTabViewModel;
|
||||
}
|
||||
|
||||
public ObservableCollection<ActivatableViewModelBase> SettingTabs { get; }
|
||||
|
||||
Reference in new issue
Block a user