-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added up to 18 custom user colours in the colour picker palette (#2422)
- Loading branch information
Showing
4 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* ct_types.h | ||
* | ||
* Copyright 2009-2023 | ||
* Copyright 2009-2024 | ||
* Giuseppe Penone <[email protected]> | ||
* Evgenii Gurianov <https://github.com/txe> | ||
* | ||
|
@@ -206,6 +206,29 @@ struct CtRecentDocsFilepaths : public CtMaxSizedList<fs::path> | |
CtRecentDocsFilepaths() : CtMaxSizedList<fs::path>{10} {} | ||
}; | ||
|
||
struct CtColoursUserPalette : public CtMaxSizedList<Gdk::RGBA> | ||
{ | ||
CtColoursUserPalette() : CtMaxSizedList<Gdk::RGBA>{18} {} | ||
std::string serialise_to_colon_sep() const { | ||
std::string outString; | ||
bool firstIteration{true}; | ||
for (const Gdk::RGBA& element : *this) { | ||
if (not firstIteration) outString += ":"; | ||
else firstIteration = false; | ||
outString += element.to_string(); | ||
} | ||
return outString; | ||
} | ||
Gdk::RGBA* at(const int i) { | ||
int idx{0}; | ||
for (Gdk::RGBA& element : *this) { | ||
if (i == idx) return &element; | ||
++idx; | ||
} | ||
return nullptr; | ||
} | ||
}; | ||
|
||
class CtStringSplittable | ||
{ | ||
private: | ||
|