# CutBox.app

## Coverage Report

#### Created: 2024-03-12 03:40

    .../Source/App/Preferences/PreferencesThemeSelectionView+UseCompactUI.swift

    Line

    Count

    Source (jump to first uncovered line)

    1

    //

    2

    //  PreferencesThemeSelectionView+UseCompactUI.swift

    3

    //  CutBox

    4

    //

    5

    //  Created by Jason Milkins on 29/4/18.

    6

    //  Copyright © 2018-2023 ocodo. All rights reserved.

    7

    //

    8

    9

    import RxCocoa

    10

    import RxSwift

    11

    12

    extension PreferencesThemeSelectionView {

    13

    14

    49

        func setupCompactUIControl() {

    15

    49

            self.compactUICheckbox.title = "preferences_use_compact_ui".l7n

    16

    49

            self.compactUICheckbox.toolTip = "preferences_use_compact_ui_tooltip".l7n

    17

    49

    18

    49

            self.compactUICheckbox.state = self.prefs.useCompactUI ? .on : .off

    19

    49

    20

    49

            self.compactUICheckbox.rx.state

    21

    49

                .map { $0 == .on }

    22

    49

                .subscribe(onNext: { self.prefs.useCompactUI = $0 })

    23

    49

                .disposed(by: disposeBag)

    24

    49

    25

    5.98k

            self.prefs.events.subscribe(onNext: onNext)

    $s15CutBoxUnitTests29PreferencesThemeSelectionViewC21setupCompactUIControlyyFyAA0abE5EventOcACcfu_

    Line

    Count

    Source

    25

    49

            self.prefs.events.subscribe(onNext: onNext)

    $s15CutBoxUnitTests29PreferencesThemeSelectionViewC21setupCompactUIControlyyFyAA0abE5EventOcACcfu_yAFcfu0_

    Line

    Count

    Source

    25

    5.93k

            self.prefs.events.subscribe(onNext: onNext)

    26

    49

                .disposed(by: disposeBag)

    27

    49

        }

    28

    29

    5.93k

        func onNext(event: CutBoxPreferencesEvent) {

    30

    5.93k

            if case .compactUISettingChanged(let isOn) = event {

    31

    1.17k

                self.compactUICheckbox.state = isOn ? .on : .off

    32

    5.93k

            }

    33

    5.93k

        }

    34

    }