feat: color a site from its address, and offer a failed web page to the system browser
This commit is contained in:
parent
56db479df0
commit
9d9f09ebc7
24 changed files with 597 additions and 25 deletions
|
|
@ -114,6 +114,10 @@ class BrowserController {
|
|||
final backPage = signal<MewsPage?>(null);
|
||||
final forwardPage = signal<MewsPage?>(null);
|
||||
|
||||
/// The address the reader is standing on, which an error page speaks about.
|
||||
/// Empty when there is nowhere to be yet.
|
||||
String get currentAddress => _stackIndex >= 0 ? _stack[_stackIndex] : '';
|
||||
|
||||
bool get canGoBack => _stackIndex > 0;
|
||||
bool get canGoForward => _stackIndex >= 0 && _stack.length - 1 > _stackIndex;
|
||||
|
||||
|
|
@ -176,10 +180,16 @@ class BrowserController {
|
|||
_stack[_stackIndex] = candidate;
|
||||
_updateNeighbors();
|
||||
await _loadCurrent();
|
||||
// The address as typed is the closer match; keep its error when the
|
||||
// wap. attempt does not work either.
|
||||
// The address as followed is the closer match: when the wap.
|
||||
// attempt does not work either, its error is the one to show and the
|
||||
// stack goes back to the address the reader followed, so the
|
||||
// address bar and anything acting on the failure (like opening the
|
||||
// page in a web browser) speak of the real address, not the guess.
|
||||
if (error.value != null && firstError != null) {
|
||||
error.value = firstError;
|
||||
candidate = url;
|
||||
_stack[_stackIndex] = url;
|
||||
_updateNeighbors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class ReaderSettingsController {
|
|||
/// setting arrives as a link the reader can also type, so a value outside
|
||||
/// these lists is refused rather than stored.
|
||||
static const themeModes = ['light', 'dark', 'system'];
|
||||
static const variants = ['site', 'warm', 'cool', 'green', 'mono'];
|
||||
static const variants = ['site', 'host', 'warm', 'cool', 'green', 'mono'];
|
||||
|
||||
final font = signal(defaultFontFamily);
|
||||
final fontScale = signal(1.0);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const _themeLabels = {
|
|||
|
||||
const _variantLabels = {
|
||||
'site': 'settings-variant-site',
|
||||
'host': 'settings-variant-host',
|
||||
'warm': 'settings-variant-warm',
|
||||
'cool': 'settings-variant-cool',
|
||||
'green': 'settings-variant-green',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue