Skip to content

Commit

Permalink
improve layout for long templated functions
Browse files Browse the repository at this point in the history
- template parameters can wrap to the next line when they get too long
- return types can wrap on small screens when they get too long
- additional spacing was added to the member declarations table
- add support for class template parameters

fixes #84
  • Loading branch information
jothepro committed Aug 29, 2022
1 parent 5bf1d5f commit c6568eb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 15 additions & 1 deletion doxygen-awesome.css
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ div.memproto div.memtemplate {
color: var(--primary-dark-color);
font-size: var(--memname-font-size);
margin-left: 2px;
text-shadow: none;
}

table.mlabels, table.mlabels > tbody {
Expand Down Expand Up @@ -1732,6 +1733,7 @@ table.memberdecls tr[class^='memitem'] .memTemplParams {
font-family: var(--font-family-monospace);
font-size: var(--code-font-size);
color: var(--primary-dark-color);
white-space: normal;
}

table.memberdecls .memItemLeft,
Expand All @@ -1757,7 +1759,7 @@ table.memberdecls .memTemplParams {
border-left: 1px solid var(--separator-color);
border-right: 1px solid var(--separator-color);
border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
padding-bottom: 0;
padding-bottom: var(--spacing-small);
}

table.memberdecls .memTemplItemLeft {
Expand Down Expand Up @@ -1794,6 +1796,11 @@ table.memberdecls .mdescLeft, table.memberdecls .mdescRight {
padding: var(--spacing-small) 0;
}

table.memberdecls .memItemLeft,
table.memberdecls .memTemplItemLeft {
padding-right: var(--spacing-medium);
}

table.memberdecls .memSeparator {
background: var(--page-background-color);
height: var(--spacing-large);
Expand Down Expand Up @@ -1837,6 +1844,12 @@ div.dynheader img[src="closed.png"] {

}

.compoundTemplParams {
font-family: var(--font-family-monospace);
color: var(--primary-dark-color);
font-size: var(--code-font-size);
}

@media screen and (max-width: 767px) {

table.memberdecls .memItemLeft,
Expand All @@ -1853,6 +1866,7 @@ div.dynheader img[src="closed.png"] {
border-right: none;
border-left: none;
border-radius: 0;
white-space: normal;
}

table.memberdecls .memItemLeft,
Expand Down
16 changes: 13 additions & 3 deletions include/MyLibrary/subclass-example.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace MyLibrary {
/**
* @brief some subclass
*/
template<typename TemplatedClass>
class SubclassExample : public Example {
public:

Expand All @@ -18,13 +19,22 @@ namespace MyLibrary {
int virtualfunc() override;

/**
* @brief Extra long function with lots of parameters
* @brief Template function function
*/
template <typename T>
std::shared_ptr<std::string> function_template_test(std::shared_ptr<T>& param);

/**
* @brief Extra long function with lots of parameters and many template types.
*
* Also has a long return type.
*
* @param param1 first parameter
* @param param2 second parameter
* @param parameter3 third parameter
*/
template <typename T>
std::shared_ptr<std::string> long_function_with_many_parameters(std::shared_ptr<T>& param1, std::shared_ptr<std::string>& param2, bool parameter3) {
template <typename T, typename Foo, typename Bar, typename Alice, typename Bob, typename Charlie, typename Hello, typename World>
std::pair<std::string, std::string> long_function_with_many_parameters(std::shared_ptr<T>& param1, std::shared_ptr<std::string>& param2, bool parameter3, Alice paramater4 Bob parameter 5) {
if(true) {
std::cout << "this even has some code." << std::endl;
}
Expand Down

0 comments on commit c6568eb

Please sign in to comment.