index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff
author y2w8 <yousefalharby416@gmail.com> 2026-06-16 19:59:27 +0300
committer y2w8 <yousefalharby416@gmail.com> 2026-06-16 19:59:27 +0300
commit 5d7f1366be0ab6a894991ffdfd7b1627b9273f11 [patch]
tree 6fc765c4c1f0a96d25cab234b61c75ae7eb263f5
parent 6debeadf793f6782fe54510fff9dcba0869b0a4f
download 5d7f1366be0ab6a894991ffdfd7b1627b9273f11.tar.gz

chore: format.

Diffstat

-rw-r--r-- src/config.rs 5
-rw-r--r-- .github/workflows/ci.yml 2
-rw-r--r-- src/ui/popup.rs 4
-rw-r--r-- src/ui/table.rs 21
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/config.rs b/src/config.rs
index 3daec83..6026755 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -4,8 +4,11 @@
    path::PathBuf,
};

use ron::{de::{self}, ser::PrettyConfig};
use ron::ser::{self};
use ron::{
    de::{self},
    ser::PrettyConfig,
};
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 098418d..2351937 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@
      - uses: Swatinem/rust-cache@v2

      - name: Format
        run: cargo fmt --all
        run: cargo fmt --all -- --check

      - name: Lint
        run: cargo clippy --all-targets --all-features -- -D warnings
diff --git a/src/ui/popup.rs b/src/ui/popup.rs
index d36ed9d..0df0502 100644
--- a/src/ui/popup.rs
+++ b/src/ui/popup.rs
@@ -76,7 +76,7 @@
    // Cursor position x
    let cx = input_chunks[0].x + input.cx as u16;

    // cx_max = position + width - 1 (so the cursor does overlap on eye icon) 
    let cx_max = input_chunks[0].x + input_chunks[0].width.saturating_sub(1); 
    // cx_max = position + width - 1 (so the cursor does overlap on eye icon)
    let cx_max = input_chunks[0].x + input_chunks[0].width.saturating_sub(1);
    f.set_cursor_position(layout::Position::new(cx.min(cx_max), input_chunks[0].y))
}
diff --git a/src/ui/table.rs b/src/ui/table.rs
index e64076d..7c05ca2 100644
--- a/src/ui/table.rs
+++ b/src/ui/table.rs
@@ -3,7 +3,11 @@
    ui::{self, Margin, list::StatefulList},
};
use ratatui::{
    Frame, layout::{Constraint, Flex, Rect}, style::Style, text::Line, widgets::{Block, BorderType, Row, Table}
    Frame,
    layout::{Constraint, Flex, Rect},
    style::Style,
    text::Line,
    widgets::{Block, BorderType, Row, Table},
};

pub struct TableData<'a, T> {
@@ -39,7 +43,11 @@
        Style::new()
    };
    let table = Table::new(table_data.cells.clone(), table_data.constraint.clone())
        .header(Row::new(table_data.header_cols.clone()).style(header_style).bottom_margin(1))
        .header(
            Row::new(table_data.header_cols.clone())
                .style(header_style)
                .bottom_margin(1),
        )
        .block(
            Block::bordered()
                .title(table_data.title)
@@ -221,14 +229,7 @@
        .map(|dev| -> Row<'_> {
            Row::new(vec![
                Line::from(dev.interface.clone()).centered(),
                Line::from(
                    if dev.state.is_enabled() {
                        "On"
                    } else {
                        "Off"
                    },
                )
                .centered(),
                Line::from(if dev.state.is_enabled() { "On" } else { "Off" }).centered(),
                Line::from(format!("{}", dev.state)).centered(),
                Line::from(format!("{} MHz", dev.active_frequency_mhz.unwrap_or(0))).centered(),
                Line::from(dev.hw_address.to_string()).centered(),