Make fluent the new default style

It's not ugly :-)
This commit is contained in:
Simon Hausmann 2021-08-10 15:44:54 +02:00
parent 1fca971fa8
commit 01c3347d19
9 changed files with 15 additions and 14 deletions

View file

@ -53,7 +53,7 @@ jobs:
- name: Set default style - name: Set default style
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: | run: |
echo "SIXTYFPS_STYLE=ugly" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
@ -182,7 +182,7 @@ jobs:
- name: Set default style - name: Set default style
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: | run: |
echo "SIXTYFPS_STYLE=ugly" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v2 uses: actions/cache@v2

View file

@ -22,7 +22,7 @@ jobs:
- aarch64-unknown-linux-gnu - aarch64-unknown-linux-gnu
env: env:
SIXTYFPS_NO_QT: 1 SIXTYFPS_NO_QT: 1
SIXTYFPS_STYLE: ugly SIXTYFPS_STYLE: fluent
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx

View file

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
the `self` element now refer to the correct element instead of the root. the `self` element now refer to the correct element instead of the root.
- Rust: defaults to the native style if Qt is available - Rust: defaults to the native style if Qt is available
- Rust: deprecated `SharedVector::as_slice_mut()`. Use `SharedVector::as_mut_slice()` instead. - Rust: deprecated `SharedVector::as_slice_mut()`. Use `SharedVector::as_mut_slice()` instead.
- The default non-native widget style is now the new "fluent" style.
### Added ### Added

View file

@ -163,7 +163,7 @@ fn process_file_source(
let mut compiler_config = sixtyfps_compilerlib::CompilerConfiguration::new( let mut compiler_config = sixtyfps_compilerlib::CompilerConfiguration::new(
sixtyfps_compilerlib::generator::OutputFormat::Interpreter, sixtyfps_compilerlib::generator::OutputFormat::Interpreter,
); );
compiler_config.style = Some("ugly".into()); compiler_config.style = Some("fluent".into());
let compile_diagnostics = if !parse_diagnostics.has_error() { let compile_diagnostics = if !parse_diagnostics.has_error() {
let (_, build_diags) = spin_on::spin_on(sixtyfps_compilerlib::compile_syntax_node( let (_, build_diags) = spin_on::spin_on(sixtyfps_compilerlib::compile_syntax_node(
syntax_node.clone(), syntax_node.clone(),

View file

@ -91,12 +91,12 @@ impl<'a> TypeLoader<'a> {
let is_wasm = cfg!(target_arch = "wasm32") let is_wasm = cfg!(target_arch = "wasm32")
|| std::env::var("TARGET").map_or(false, |t| t.starts_with("wasm")); || std::env::var("TARGET").map_or(false, |t| t.starts_with("wasm"));
if !is_wasm { if !is_wasm {
diag.push_diagnostic_with_span("SIXTYFPS_STYLE not defined, defaulting to 'ugly', see https://github.com/sixtyfpsui/sixtyfps/issues/83 for more info".to_owned(), diag.push_diagnostic_with_span("SIXTYFPS_STYLE not defined, defaulting to 'fluent', see https://github.com/sixtyfpsui/sixtyfps/issues/83 for more info".to_owned(),
Default::default(), Default::default(),
crate::diagnostics::DiagnosticLevel::Warning crate::diagnostics::DiagnosticLevel::Warning
); );
} }
Cow::from("ugly") Cow::from("fluent")
}); });
let builtin_library = let builtin_library =
@ -471,7 +471,7 @@ fn test_dependency_loading() {
let mut compiler_config = let mut compiler_config =
CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter); CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter);
compiler_config.include_paths = vec![incdir]; compiler_config.include_paths = vec![incdir];
compiler_config.style = Some("ugly".into()); compiler_config.style = Some("fluent".into());
let mut main_test_path = test_source_path.clone(); let mut main_test_path = test_source_path.clone();
main_test_path.push("dependency_test_main.60"); main_test_path.push("dependency_test_main.60");
@ -506,7 +506,7 @@ fn test_load_from_callback_ok() {
let mut compiler_config = let mut compiler_config =
CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter); CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter);
compiler_config.style = Some("ugly".into()); compiler_config.style = Some("fluent".into());
compiler_config.open_import_fallback = Some(Rc::new(move |path| { compiler_config.open_import_fallback = Some(Rc::new(move |path| {
let ok_ = ok_.clone(); let ok_ = ok_.clone();
Box::pin(async move { Box::pin(async move {
@ -548,7 +548,7 @@ X := XX {}
fn test_manual_import() { fn test_manual_import() {
let mut compiler_config = let mut compiler_config =
CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter); CompilerConfiguration::new(crate::generator::OutputFormat::Interpreter);
compiler_config.style = Some("ugly".into()); compiler_config.style = Some("fluent".into());
let global_registry = TypeRegister::builtin(); let global_registry = TypeRegister::builtin();
let mut build_diagnostics = BuildDiagnostics::default(); let mut build_diagnostics = BuildDiagnostics::default();
let mut loader = TypeLoader::new(global_registry, &compiler_config, &mut build_diagnostics); let mut loader = TypeLoader::new(global_registry, &compiler_config, &mut build_diagnostics);

View file

@ -639,7 +639,7 @@ pub async fn load(
compiler_config.style = Some(if sixtyfps_rendering_backend_default::HAS_NATIVE_STYLE { compiler_config.style = Some(if sixtyfps_rendering_backend_default::HAS_NATIVE_STYLE {
"native".to_owned() "native".to_owned()
} else { } else {
"ugly".to_owned() "fluent".to_owned()
}); });
} }

View file

@ -39,6 +39,6 @@ fn main() {
// and we want to write to a common directory, so write in the build/ dir // and we want to write to a common directory, so write in the build/ dir
let target_path = let target_path =
Path::new(&out_dir).parent().unwrap().parent().unwrap().join("SIXTYFPS_DEFAULT_STYLE.txt"); Path::new(&out_dir).parent().unwrap().parent().unwrap().join("SIXTYFPS_DEFAULT_STYLE.txt");
std::fs::write(target_path, if has_native_style { b"native\n" as &[u8] } else { b"ugly\n" }) std::fs::write(target_path, if has_native_style { b"native\n" as &[u8] } else { b"fluent\n" })
.unwrap(); .unwrap();
} }

View file

@ -51,7 +51,7 @@ struct Cli {
)] )]
include_paths: Vec<std::path::PathBuf>, include_paths: Vec<std::path::PathBuf>,
/// The style name for the preview ('native' or 'ugly') /// The style name for the preview ('native', 'fluent' or 'ugly')
#[structopt(long, name = "style name", default_value)] #[structopt(long, name = "style name", default_value)]
style: String, style: String,
@ -178,7 +178,7 @@ fn main_loop(connection: &Connection, params: serde_json::Value) -> Result<(), E
let mut compiler_config = let mut compiler_config =
CompilerConfiguration::new(sixtyfps_compilerlib::generator::OutputFormat::Interpreter); CompilerConfiguration::new(sixtyfps_compilerlib::generator::OutputFormat::Interpreter);
compiler_config.style = compiler_config.style =
Some(if cli_args.style.is_empty() { "ugly".into() } else { cli_args.style }); Some(if cli_args.style.is_empty() { "fluent".into() } else { cli_args.style });
compiler_config.include_paths = cli_args.include_paths; compiler_config.include_paths = cli_args.include_paths;
let mut document_cache = DocumentCache::new(&compiler_config); let mut document_cache = DocumentCache::new(&compiler_config);

View file

@ -24,8 +24,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="style_combo">Style:</label> <label for="style_combo">Style:</label>
<select id="style_combo"> <select id="style_combo">
<option value="ugly">ulgy</option>
<option value="fluent">fluent</option> <option value="fluent">fluent</option>
<option value="ugly">ulgy</option>
</select> </select>
</p> </p>