Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Continuous integration: run the test suite on Linux x64 (ubuntu-latest).
# Only FreeBSD runs `cargo test` today; this adds the main platform.
name: CI

on:
push:
branches: [main]
pull_request:
paths:
- Cargo.toml
- Cargo.lock
- "**/Cargo.toml"
- .github/workflows/ci.yml
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
RUST_TEST_THREADS: "4"

jobs:
linux-x64:
name: Linux x86_64 (build + test)
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
retry: 3
# Optional font build input so Japanese/Chinese font tests run (they skip without it).
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: storytold/craft-fonts
ref: 8dcdacd5153e64560d109541a47d806f26f048c0
path: craft-fonts
retry: 3
- uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable
with:
retry: 3
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
key: ci-linux-x64-${{ hashFiles('Cargo.lock') }}
- name: Cache apt packages
uses: actions/cache@0400d5f644914a3c2c8c16d6b72f5c0a3a9b7c1e # v4.2.1
with:
path: |
/var/cache/apt
/usr/lib
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev \
desktop-file-utils appstream python3-yaml zsync \
pkg-config libfontconfig1-dev libfreetype6-dev
- name: Run cargo xtask ci
env:
CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts
CRAFT_FONTS_REQUIRED: "1"
CARGO_TARGET_DIR: ${{ runner.temp }}/target
run: cargo xtask ci
30 changes: 15 additions & 15 deletions crates/ui-egui/src/panels/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,21 +561,21 @@ fn histogram(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
// EXIF strip
if let Some(ph) = app.session.catalog.photo(id) {
let m = &ph.meta;
let items = [
m.iso.map(|i| format!("ISO {i}")).unwrap_or_default(),
m.focal_mm.map(|f| format!("{f:.0}mm")).unwrap_or_default(),
m.aperture.map(|a| format!("f/{a:.1}")).unwrap_or_default(),
m.shutter.clone(),
];
let y = r.bottom() - 13.0;
for (i, s) in items.iter().enumerate() {
let x = r.left() + 18.0 + (r.width() - 36.0) * i as f32 / 3.0;
let align = match i {
0 => Align2::LEFT_CENTER,
3 => Align2::RIGHT_CENTER,
_ => Align2::CENTER_CENTER,
};
p.text(pos2(x, y), align, s, t.font(12.5), t.text_label);
let parts: Vec<String> = [
m.iso.map(|i| format!("ISO {i}")),
m.focal_mm.map(|f| format!("{f:.0}mm")),
m.aperture.map(|a| format!("f/{a:.1}")),
if m.shutter.is_empty() { None } else { Some(m.shutter.clone()) },
]
.into_iter()
.flatten()
.collect();

if !parts.is_empty() {
let text = parts.join(" · ");
let y = r.bottom() - 13.0;
let x = r.left() + r.width() / 2.0;
p.text(pos2(x, y), Align2::CENTER_CENTER, text, t.font(12.5), t.text_label);
}
}
}
Expand Down