Skip to content

Commit 8c9d69c

Browse files
authored
SG-40506: Add space between option and arrow and make cmake detect qss changes (#1058)
### **[SG-40506](https://jira.autodesk.com/browse/SG-40506): Flow Production Tracking' option collides with arrow indicator within File menu in timeline** ### Summarize your change. Increased padding-right to the menu items such that the right arrow is no longer right next to the menu item text. Changed the cmake file to be able to detect changes to the qss files and update the binaries when change is made. ### Describe the reason for the change. Previously, the right arrow would be extremely close to the menu item text that was the longest. This fix makes the menu look less cramped. As for the cmake file, we realized that when updating the .qss files, despite rebuilding RV, the changes would not get picked up. After changing the cmake file, when making changes in the .qss files, they get picked up correctly and the new build would properly show the changes. ### Describe what you have tested and on which operating system. Tested the cmake file to see if it detects changes to .qss files and include them when rebuilding and tested the extra padding to see if the text is still cramped. Both were tested on macOS ### If possible, provide screenshots. The right arrow is no longer right next to the longest menu item <img width="2052" height="1328" alt="image" src="https://github.com/user-attachments/assets/4d20a4c3-6206-4c7e-b6bc-52e0209b72f6" /> Signed-off-by: chenl1 <ling.jie.chen@autodesk.com>
1 parent e0833e6 commit 8c9d69c

5 files changed

Lines changed: 16 additions & 50 deletions

File tree

cmake/macros/rv_quote_file.cmake

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -104,52 +104,18 @@ FUNCTION(quote_file OUTPUT_FILENAME)
104104
"${CMAKE_CURRENT_BINARY_DIR}/${_stem}.cpp"
105105
)
106106

107-
GET_FILENAME_COMPONENT(input_file_name ${arg_INPUT_FILENAME} NAME)
108-
SET(input_timestamp_file
109-
${CMAKE_CURRENT_BINARY_DIR}/${input_file_name}.timestamp
110-
)
111-
FILE(TIMESTAMP ${arg_INPUT_FILENAME} _input_file_timestamp)
112-
IF(EXISTS ${input_timestamp_file})
113-
FILE(READ ${input_timestamp_file} _saved_input_file_timestamp)
114-
IF(${_input_file_timestamp} EQUAL ${_saved_input_file_timestamp})
115-
SET(${OUTPUT_FILENAME}
116-
${_dest_name}
117-
PARENT_SCOPE
118-
)
119-
RETURN()
120-
ENDIF()
121-
ENDIF()
122-
FILE(
123-
WRITE ${input_timestamp_file}
124-
${_input_file_timestamp}
107+
# Use ADD_CUSTOM_COMMAND to track the dependency properly
108+
ADD_CUSTOM_COMMAND(
109+
OUTPUT ${_dest_name}
110+
COMMAND python3 ${_quote_file} "${_src_name}" "${_dest_name}" "${arg_CPP_SYMBOL}"
111+
DEPENDS ${_src_name}
112+
COMMENT "Quoting '${arg_INPUT_FILENAME}' as '${_stem}.cpp'"
113+
VERBATIM
125114
)
126115

127-
# This check is about creating file if it doesn't exists
128-
IF(NOT EXISTS ${_dest_name})
129-
MESSAGE(STATUS "Quoting '${_src_name}' as '${_dest_name}'")
130-
EXECUTE_PROCESS(
131-
COMMAND python3 ${_quote_file} "${_src_name}" "${_dest_name}" "${arg_CPP_SYMBOL}"
132-
RESULT_VARIABLE _result
133-
)
134-
IF(_result)
135-
MESSAGE(FATAL_ERROR "Couldn't create file from '${_src_name}'")
136-
ENDIF()
137-
ENDIF()
138-
139-
# This check is about confirming the above did created a file
140-
IF(EXISTS ${_dest_name})
141-
# File exists ... check size
142-
FILE(SIZE ${_dest_name} _size)
143-
IF(_size LESS_EQUAL 50) # arbitrary, but we ain't expecting anything that small
144-
MESSAGE(FATAL_ERROR "Generated file '${_dest_name}' is smaller than expected, size:${_size}")
145-
ENDIF()
146-
147-
# All checks are green returns the generated filename back to caller
148-
SET(${OUTPUT_FILENAME}
149-
${_dest_name}
150-
PARENT_SCOPE
151-
)
152-
ELSE()
153-
MESSAGE(FATAL_ERROR "Couldn't find the created file '${_dest_name}'")
154-
ENDIF()
116+
# Return the generated filename back to caller
117+
SET(${OUTPUT_FILENAME}
118+
${_dest_name}
119+
PARENT_SCOPE
120+
)
155121
ENDFUNCTION()

src/lib/app/RvCommon/rv_linux_dark.qss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ QMenu::item {
170170
padding-top: 1px;
171171
padding-bottom: 1px;
172172
padding-left: 8px;
173-
padding-right: 8px;
173+
padding-right: 20px; /* Create gap between arrow and text */
174174
margin: 2px;
175175
border-radius: 4px;
176176
}

src/lib/app/RvCommon/rv_linux_dark.qss.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ QMenu::item {
170170
padding-top: 1px;
171171
padding-bottom: 1px;
172172
padding-left: 8px;
173-
padding-right: 8px;
173+
padding-right: 20px; /* Create gap between arrow and text */
174174
margin: 2px;
175175
border-radius: 4px;
176176
}

src/lib/app/RvCommon/rv_mac_dark.qss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ QMenu::item {
160160
padding-top: 1px;
161161
padding-bottom: 1px;
162162
padding-left: 8px;
163-
padding-right: 8px;
163+
padding-right: 20px; /* Create gap between arrow and text */
164164
margin: 2px;
165165
border-radius: 4px;
166166
}

src/lib/app/RvCommon/rv_mac_dark.qss.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ QMenu::item {
161161
padding-top: 1px;
162162
padding-bottom: 1px;
163163
padding-left: 8px;
164-
padding-right: 8px;
164+
padding-right: 20px; /* Create gap between arrow and text */
165165
margin: 2px;
166166
border-radius: 4px;
167167
}

0 commit comments

Comments
 (0)