mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-06 09:13:48 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4604adb502 | ||
![]() |
add5f40d31 | ||
![]() |
805db9bdea | ||
![]() |
784f53fd7e | ||
![]() |
799d8a267e | ||
![]() |
f4513702b0 |
@ -1,6 +1,3 @@
|
|||||||
# Copyright 2025 Arthur Sonzogni. All rights reserved.
|
|
||||||
# Use of this source code is governed by the MIT license that can be found in
|
|
||||||
# the LICENSE file.
|
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
platform:
|
||||||
- centos7
|
- centos7
|
||||||
|
21
.github/workflows/publish.yaml
vendored
21
.github/workflows/publish.yaml
vendored
@ -9,33 +9,16 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
# Fire as soon as the Release workflow completes
|
|
||||||
workflow_run:
|
|
||||||
workflows:
|
|
||||||
- Release
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|
||||||
attestations: write
|
|
||||||
contents: write
|
contents: write
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
|
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
|
||||||
# Only run on manual dispatch, or when Release finishes successfully
|
|
||||||
if: |
|
|
||||||
github.event_name == 'workflow_dispatch' ||
|
|
||||||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
|
|
||||||
with:
|
with:
|
||||||
# If manual: use the input, otherwise grab the tag from the completed run
|
tag_name: ${{ github.event.inputs.tag_name }}
|
||||||
tag_name: ${{
|
|
||||||
github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name ||
|
|
||||||
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch
|
|
||||||
}}
|
|
||||||
registry_fork: ArthurSonzogni/bazel-central-registry
|
registry_fork: ArthurSonzogni/bazel-central-registry
|
||||||
|
attest: false
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
publish_token: ${{ secrets.PUBLISH_TOKEN }}
|
publish_token: ${{ secrets.PUBLISH_TOKEN }}
|
||||||
|
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
@ -92,27 +92,9 @@ jobs:
|
|||||||
run: >
|
run: >
|
||||||
git archive --format=tar.gz -o source.tar.gz HEAD
|
git archive --format=tar.gz -o source.tar.gz HEAD
|
||||||
|
|
||||||
- name: Generate source attestation
|
|
||||||
id: attest_source
|
|
||||||
uses: actions/attest-build-provenance@v2
|
|
||||||
with:
|
|
||||||
subject-path: source.tar.gz
|
|
||||||
|
|
||||||
- name: Write source.intoto.jsonl
|
|
||||||
run:
|
|
||||||
jq --compact-output < "${{ steps.attest_source.outputs.bundle-path }}" \
|
|
||||||
> source.tar.gz.intoto.jsonl
|
|
||||||
|
|
||||||
- name: "Upload source package"
|
- name: "Upload source package"
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: source.tar.gz
|
asset_path: source.tar.gz
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
- name: "Upload source attestation"
|
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
|
||||||
asset_path: source.tar.gz.intoto.jsonl
|
|
||||||
overwrite: true
|
|
||||||
|
@ -4,7 +4,11 @@ Changelog
|
|||||||
Future release
|
Future release
|
||||||
------------
|
------------
|
||||||
|
|
||||||
6.1.4 (2025-05-01)
|
### dom
|
||||||
|
- Bugfix: Restore the `dbox` behavior from ftxui 5.0.0. To apply bgcolor
|
||||||
|
blending between the two layers, a new `dboxBlend` will be added.
|
||||||
|
|
||||||
|
6.1.8 (2025-05-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
@ -15,7 +19,7 @@ Future release
|
|||||||
|
|
||||||
**MODULE.bazel**
|
**MODULE.bazel**
|
||||||
```bazel
|
```bazel
|
||||||
bazel_dep(name = "ftxui", version = "6.1.4")
|
bazel_dep(name = "ftxui", version = "6.1.8")
|
||||||
```
|
```
|
||||||
|
|
||||||
**BUILD.bazel**
|
**BUILD.bazel**
|
||||||
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
|||||||
|
|
||||||
project(ftxui
|
project(ftxui
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
VERSION 6.1.4
|
VERSION 6.1.8
|
||||||
DESCRIPTION "C++ Functional Terminal User Interface."
|
DESCRIPTION "C++ Functional Terminal User Interface."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
# Copyright 2025 Arthur Sonzogni. All rights reserved.
|
|
||||||
# Use of this source code is governed by the MIT license that can be found in
|
|
||||||
# the LICENSE file.
|
|
||||||
|
|
||||||
# FTXUI Module.
|
# FTXUI Module.
|
||||||
module(name = "ftxui", version = "6.1.4")
|
module(name = "ftxui", version = "6.1.8", compatibility_level = 6)
|
||||||
|
|
||||||
# Build deps.
|
# Build deps.
|
||||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||||
|
@ -348,6 +348,7 @@ Feel free to add your projects here:
|
|||||||
- [terminal-rain](https://github.com/Oakamoore/terminal-rain)
|
- [terminal-rain](https://github.com/Oakamoore/terminal-rain)
|
||||||
- [keywords](https://github.com/Oakamoore/keywords) ([Play web version :heart:](https://oakamoore.itch.io/keywords))
|
- [keywords](https://github.com/Oakamoore/keywords) ([Play web version :heart:](https://oakamoore.itch.io/keywords))
|
||||||
- [FTB - tertminal file browser](https://github.com/Cyxuan0311/FTB)
|
- [FTB - tertminal file browser](https://github.com/Cyxuan0311/FTB)
|
||||||
|
- [SHOOT!](https://github.com/ShingZhanho/ENGG1340-Project-25Spring)
|
||||||
|
|
||||||
### [cpp-best-practices/game_jam](https://github.com/cpp-best-practices/game_jam)
|
### [cpp-best-practices/game_jam](https://github.com/cpp-best-practices/game_jam)
|
||||||
|
|
||||||
@ -372,7 +373,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
FetchContent_Declare(ftxui
|
FetchContent_Declare(ftxui
|
||||||
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
||||||
GIT_TAG v6.1.4
|
GIT_TAG v6.1.8
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_GetProperties(ftxui)
|
FetchContent_GetProperties(ftxui)
|
||||||
|
@ -45,59 +45,6 @@ class DBox : public Node {
|
|||||||
child->SetBox(box);
|
child->SetBox(box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Render(Screen& screen) override {
|
|
||||||
if (children_.size() <= 1) {
|
|
||||||
Node::Render(screen);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int width = box_.x_max - box_.x_min + 1;
|
|
||||||
const int height = box_.y_max - box_.y_min + 1;
|
|
||||||
std::vector<Pixel> pixels(std::size_t(width * height));
|
|
||||||
|
|
||||||
for (auto& child : children_) {
|
|
||||||
child->Render(screen);
|
|
||||||
|
|
||||||
// Accumulate the pixels
|
|
||||||
Pixel* acc = pixels.data();
|
|
||||||
for (int x = 0; x < width; ++x) {
|
|
||||||
for (int y = 0; y < height; ++y) {
|
|
||||||
auto& pixel = screen.PixelAt(x + box_.x_min, y + box_.y_min);
|
|
||||||
acc->background_color =
|
|
||||||
Color::Blend(acc->background_color, pixel.background_color);
|
|
||||||
acc->automerge = pixel.automerge || acc->automerge;
|
|
||||||
if (pixel.character.empty()) {
|
|
||||||
acc->foreground_color =
|
|
||||||
Color::Blend(acc->foreground_color, pixel.background_color);
|
|
||||||
} else {
|
|
||||||
acc->blink = pixel.blink;
|
|
||||||
acc->bold = pixel.bold;
|
|
||||||
acc->dim = pixel.dim;
|
|
||||||
acc->inverted = pixel.inverted;
|
|
||||||
acc->italic = pixel.italic;
|
|
||||||
acc->underlined = pixel.underlined;
|
|
||||||
acc->underlined_double = pixel.underlined_double;
|
|
||||||
acc->strikethrough = pixel.strikethrough;
|
|
||||||
acc->hyperlink = pixel.hyperlink;
|
|
||||||
acc->character = pixel.character;
|
|
||||||
acc->foreground_color = pixel.foreground_color;
|
|
||||||
}
|
|
||||||
++acc; // NOLINT
|
|
||||||
|
|
||||||
pixel = Pixel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Render the accumulated pixels:
|
|
||||||
Pixel* acc = pixels.data();
|
|
||||||
for (int x = 0; x < width; ++x) {
|
|
||||||
for (int y = 0; y < height; ++y) {
|
|
||||||
screen.PixelAt(x + box_.x_min, y + box_.y_min) = *acc++; // NOLINT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user